I have some code that retrieves data from multiple websites via Internet Explorer automation in VBA. My code worked without problems with IE8, but in IE11, after the Navigate method of the Internet Explorer object is called, the Document and LocationURL are not updated; they still refer to the previously displayed website. Here's some code to reproduce the problem:
Sub Test()
Debug.Print "start"
Dim ie
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True
ie.Navigate "http://en.wikipedia.org/wiki/Visual_Basic"
wait ie
Debug.Print "Current URL: " & ie.LocationURL
ie.Navigate "http://en.wikipedia.org/wiki/Microsoft_Office"
wait ie
Debug.Print "Current URL: " & ie.LocationURL
Set ie = Nothing
End Sub
Sub Wait(ie As Variant)
Do While ie.Busy
Application.wait DateAdd("s", 1, Now)
Loop
End Sub
When a run the above Test sub on a machine with IE8, it prints two different URLs, which is the expected behavior. However, when I run the same code on a machine with IE11, it prints the first URL twice. Any idea what might be wrong?
Update: I couldn't find a solution, so I went for the workaround of opening a new IE window for each URL.
THX, You helped me. W7 Ultimate 64bit czech, IE11, VBA in Microstation V8i I use code like:
I am not familiar with the VBA IE automation that you are using, however it sounds like you are hitting the same issue as Selenium WebDriver on IE11.
You may need to follow the same steps provided by the in the Selenium Wiki.
http://code.google.com/p/selenium/wiki/InternetExplorerDriver
Hopefully that fixes your problem!