title: Excel VBA: Automation error- Remote procedure call failed
body: <p>I am extracting certain data from a website. I have to do this task for at least million rows from a table. I am using excel VBA to connect with MySQL.</p>
  
  <ul>
  <li>Using MySQL to connect with excel VBA, I am getting first name, last name of an author from a table. </li>
  <li>For the first name, last name of an author, I am appending Linkedin to the search query and  I am searching in Google. </li>
  <li>From the search results, I am opening the first search result page in the HTML format and extracting some information.</li>
  <li>I put back some of the extracted information into MySQL tables. </li>
  </ul>
  
  <p>Everything works fine as per the above steps. However, if I try to do it for more than 10 rows I get the following error. </p>
  
  <blockquote>
    <p>Automation error the remote procedure call failed and did not execute</p>
  </blockquote>
  
  <p>I realize it is something to do with the opening/closing of IE. In my program, I have the following code. </p>
  
  <p>To create a new IE application, I have defined as below. </p>
  
  <pre><code>Set ie = New InternetExplorer
  Set RegEx = New RegExp
  Dim iedoc As Object
  ie.Navigate "http://www.google.com/search?hl=en&amp;q=" &amp; FirstName &amp; "+" &amp; LastName &amp;  
  "+linkedin&amp;meta="
  Do Until ie.ReadyState = READYSTATE_COMPLETE
  Loop
  MyStr = ie.Document.body.innerText
  Set RegMatch = RegEx.Execute(MyStr)
  </code></pre>
  
  <p>After extracting the data for one author, I have the below piece of code at the end. </p>
  
  <pre><code>ie.Quit
  Set RegEx = Nothing
  Set ie = Nothing
  Dim strBatchName As String
  strBatchName = "F:\command.bat"
  Shell strBatchName
  </code></pre>
  
  <p>The command.bat has the following code. </p>
  
  <pre><code>taskkill.exe /F /IM iexplore.exe /T
  </code></pre>
  
  <p>It works perfectly fine if I have lesser than 10 rows in my table. However, for more number of rows I do get the above mentioned error. </p>