Trying to run some simple code, just to open a website up. However keep getting Automation Error: The object invoked has disconnected from its clients
. Code below. Code debugger jumps to highlighting Do While oIE.ReadyState <> 4
Sub test()
Set oIE = CreateObject("InternetExplorer.application")
oIE.Visible = True
oIE.navigate ("https://www.google.com")
Do While oIE.ReadyState = 4: Application.Wait (Now + TimeValue("0:00:01")): Loop
Do While oIE.ReadyState <> 4: Application.Wait (Now + TimeValue("0:00:01")): Loop
' example ref to DOM
MsgBox oIE.Document.GetElementsByTagName("div").Length
End Sub