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?
Sub OpenIE()
Dim IE As Object
Dim site As String
Set IE = CreateObject("InternetExplorer.Application")
site = "https://www.automateexcel.com/excel/"
IE.Visible = True
IE.navigate site
Application.StatusBar = site & " " & "is loading"
Do While IE.readyState = 4: DoEvents: Loop
Do Until IE.readyState = 4: DoEvents: Loop
Application.StatusBar = site & " " & "is loaded"
Set IE = Nothing
End Sub