I'm using an old Excel document with VBA that works fine with IE 11 on Windows 7, however on IE 11 on Windows 10 it does not work. IE 11 launches to the URL requested but that's it. Anytime I try to access a event, method, or property, it stops. No error code, no crash, just stops.
I've confirmed that my references to Microsoft Internet Controls and Microsoft HTML Object Library are included (they weren't but they are now).
Dim ie As Object
If ie Is Nothing Then
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True
End If
url = "www.myurl.com"
ie.Navigate url
While ie.ReadyState <> 4 Or ie.Busy: DoEvents: Wend
Code bellow the check never executes, I placed MsgBox code before and after for testing. Only MsgBox before the loop works, unless I try to use MsgBox ie.Document.Title
, but I can do MsgBox ie.ReadyState
or MsgBox "Loading webpage"
just fine.
Again the code works perfectly fine no problem on Windows 7 with IE 11, but does not work on Windows 10 with IE 11. Tested on multiple W7 and W10 machines with identical results.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…