title: How do i solve this "Run-Time Error '-2147023706 (800704a6)"?
body: <p>i have a big problem with this code:</p>
  
  <pre><code>Sub EstrazDati_A_ieri()
  
  Dim doc As HTMLDocument
  Dim output As Object
  
  Set IE = New InternetExplorer
  IE.Visible = False
  IE.navigate Range("D2")
  
  Do
      DoEvents
      Loop Until IE.readyState = READYSTATE_COMPLETE
  
  Set doc = IE.document
  Set output = doc.getElementsByTagName("a")
  
  For Each link In output
      If link.innerHTML = "Main" Then
          Range("D3").Value2 = link
      End If
  
  Next
  IE.Quit
  
  End Sub
  </code></pre>
  
  <p>The code is correct and it works, but sometimes after a continuous use of itself a Windows box appear with a Run-Time Error on this line:</p>
  
  <pre><code>Set IE = New InternetExplorer
  </code></pre>
  
  <p>I have already tested several solutions found on the internet but i couldn't fix it.</p>
  
  <p>p.s. I'm an Italian boy sorry for the bad English :)</p>