none
VBA Internet Explorer 10 Automation RRS feed

  • Question

  • I wrote a program under IE8 that worked fine for automating accessing a webpage, but now that my office has upgraded to IE10, it is failing.

    Here is the excerpt that is causing me so much trouble:

    Dim IE As SHDocVw.InternetExplorer
    Set IE = New SHDocVw.InternetExplorer
    Dim doc As Object
    Dim el As IHTMLElement
    
    Set doc = IE.Document
    Set el = doc.getElementById("frmusr")
    Previously, I had doc as an HTMLDocument variable. However, according to one site I checked, that should be an Object variable now. That change got me past Set doc = IE.Document. But, now Set el = doc.getElementByID is failing. The error I am receiving states that an Object is required. One website I checked told me to change el to an IHTMLElement2 type variable. I did that, but the code still failed at that location for the same reason. Any ideas?

    • Edited by VBA101 Monday, June 9, 2014 5:46 PM
    Monday, June 9, 2014 5:45 PM