title: VBA: open a website on new tab on IE and wait for it to load
body: <p>I recently learned to open websites on IE through VBA excel. Now I'm trying to add code the will check if an active IE is open and if it is, it will open a new tab to navigate the website and do the same thing over again. Unfortunately, the code I have tried doesn't work. What did I do wrong?</p>
  <pre><code>Sub OpenIE()
  Dim IE As Object
  Dim site As String
  
  Set IE = CreateObject(&quot;InternetExplorer.Application&quot;)
  site = &quot;https://www.automateexcel.com/excel/&quot;
  
  IE.Visible = True
  IE.navigate site
  
  Application.StatusBar = site &amp; &quot; &quot; &amp; &quot;is loading&quot;
  
  Do While IE.readyState = 4: DoEvents: Loop
  Do Until IE.readyState = 4: DoEvents: Loop
  
  Application.StatusBar = site &amp; &quot; &quot; &amp; &quot;is loaded&quot;
  
  Set IE = Nothing
  
  End Sub
  </code></pre>