none
IE 11 automation error RRS feed

  • Question

  • Hello!  I am having a problem when using vba to navigate on multiple pages. I have used the code on ie8 and ie9 without any problems, but in ie11, when i navigate to another url the ie.locationurl and ie.document still refers to the previous url. I noticed this only happens with php websites. Im interested in finding a way to solve this. Any help appreciated.

    Here is some example code with a php website:

    Sub test()
    Dim ie As SHDocVw.InternetExplorer
    Set ie = New SHDocVw.InternetExplorer
    
    With ie
        .navigate "https://www.facebook.com/" 
        .Visible = True
        Do While ie.Busy
        Loop
        Do While ie.readyState <> 4
        Loop
         
        .navigate "https://en.wikipedia.org/wiki/Main_Page"
        .Visible = True
        
        Debug.Print ie.locationurl
        
        Do While ie.Busy
        Loop
        Do While ie.readyState <> 4
        Loop
    End With
    End Sub 

    And here is one that works but doesn't have a php website:

    Sub test2()
    Dim ie As SHDocVw.InternetExplorer
    Set ie = New SHDocVw.InternetExplorer
    
    With ie
        .navigate "http://www.break.com/"
        .Visible = True
        Do While ie.Busy
        Loop
        Do While ie.readyState <> 4
        Loop
         
        .navigate "https://en.wikipedia.org/wiki/Main_Page"
        .Visible = True
        
        Debug.Print ie.locationurl
        
        Do While ie.Busy
        Loop
        Do While ie.readyState <> 4
        Loop
    End With
    End Sub


    • Edited by CLoud3s8 Saturday, September 19, 2015 10:15 AM
    Friday, September 18, 2015 7:38 AM