title: VBA Internet explorer Automation error
body: <p>I was trying to set up a public test environment to see if anyone would be able to help me with another question I asked this morning and I'm getting this error which I was not getting in my original code and after browsing a bit around I cannot fix: <em>Automation error - The object invoked has disconnected from its clients</em>.</p>
  
  <p><a href="https://i.stack.imgur.com/1qGdj.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1qGdj.jpg" alt="Automation error - The object invoked has disconnected from its clients"></a> </p>
  
  <p>Here is the full code:</p>
  
  <pre><code>Sub GetBranches()
      Dim objIE As InternetExplorer
      Set objIE = New InternetExplorerMedium ' create new browser
  
      objIE.Visible = True
  
      objIE.navigate "https://casadasereia.net/vbatests/viewtree241653.html"
  
      ' wait for browser
      Do While objIE.Busy = True Or objIE.readyState &lt;&gt; 4
          DoEvents
      Loop
  End Sub
  </code></pre>
  
  <p>Anyone knows how to fix this?</p>