title: Excel VBA fails to load Internet Explorer
body: <p>I have a list of local webpages (over 9000) which I want to parse with Excel VBA.
  I use Office 2013 with IE 11 on:</p>
  
  <ul>
  <li>a Windows 7 Enterprise Pro x64, 16 GB RAM, i7 - Processor but also on</li>
  <li>a Windows 8.1 Enterprise x64, 12 GB RAM, i7 - Processor</li>
  </ul>
  
  <p>The problem on both machiens is that after successfuly parsing about 70-80 pages, the programm suddenly fails to load the next webpage into IE. It gets "stuck" so to say (see comment in the code below). If I reset the programm, then it can parse without problen again about 70-80 profiles after "failing" again.</p>
  
  <p><strong>[EDIT: I'm sorry, I posted by mistake the wrong code. Here is the corrected
     version]</strong> </p>
  
  <p>Here is a part of the code:</p>
  
  <pre><code>    &lt;!-- language: lang-HTML --&gt;
  Sub ImportFromWebpage()
  
      'GLOBAL VARIABLES
      Dim html As HTMLDocument
      Dim CurrentRowPosition, ProfileNumber, TotalProfiles As Integer
      Dim TempProfileID As String
      Dim profileRange, posCounter, currentProfile As Range
          Set profileRange = Worksheets("List_of_Files").Range("B2:B20000")
          ProfileNumber = 519
          CurrentRowPosition = 520
          TotalProfiles = Application.WorksheetFunction.CountA(profileRange)
      'MsgBox "TotalProfiles = " &amp; TotalProfiles
  
  
  
      'VARIABLES NEEDED FOR PARSING HERE
      'ELEMENTS
      Dim firstIHTMLElmt, secondIHTMLElmt, thirdIHTMLElmt As IHTMLElement
      Dim firstTempIHTMLElmt, secondTempIHTMLElmt, thirdTempIHTMLElmt, fourthTempIHTMLElmt, fiftTempIHTMLElmt As IHTMLElement
      'COLLECTIONS
      Dim firstIHTMLEColl, secondIHTMLEColl, thirdIHTMLEColl As IHTMLElementCollection
      Dim firstTempIHTMLEColl, secondTempIHTMLEColl, thirdTempIHTMLEColl, fourthTempIHTMLEColl, fifthTempIHTMLEColl As IHTMLElementCollection
  
      Dim ie As InternetExplorerMedium
      Set ie = New InternetExplorerMedium
      ie.Visible = False
  
      'FROM HERE LOOPING
      For startNumber = 1 To TotalProfiles
  
          Application.StatusBar = "Loading profile " &amp; ProfileNumber &amp; " from a total of " &amp; TotalProfiles &amp; " profiles"
          'Set currentProfile = Worksheets("List_of_Files").Range("J" &amp; CurrentRowPosition) // OLD
          Set currentProfile = Worksheets("List_of_Files").Range("B" &amp; CurrentRowPosition)
          ie.navigate currentProfile
  
          Application.StatusBar = "Loading profile: " &amp; ProfileNumber &amp; "; file location: " &amp; currentProfile
              Do While ie.READYSTATE &lt;&gt; READYSTATE_COMPLETE
                  DoEvents
              Loop
  
          Application.StatusBar = "Storing " &amp; currentProfile &amp; " information into HTMLElement"
          Set html = ie.document
          Set ie = Nothing
  
      [code, code, code, code ...]
  
  
  
      Application.Wait (Now + TimeValue("0:00:02"))
  
      Next startNumber
  
      Set html = Nothing
      ie.Quit
      Set ie = Nothing
  
      MsgBox "Done parsing all profiles!"
  
  End Sub 
  </code></pre>
  
  <p>Here is a screenshot from the Windows 8.1 task manager <strong>AFTER failing to load</strong>:
  <a href="https://i.stack.imgur.com/kiWjc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kiWjc.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/VAoZI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VAoZI.png" alt="enter image description here"></a></p>
  
  <p>Dose someone have any clue about why this is happening? Not only on one machiene, but on both.</p>
  
  <p>I an not very experience with programming and even less with VBA so any help would be much appreciated.</p>