Results 1 to 10 of 10

Thread: IE automation: able to change dropdown list value but webpage doesn't update

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    Quote Originally Posted by mohanvijay
    below code works fine for me

    [vba]
    IE.Document.getElementById("list").selectedIndex = 8
    IE.Document.getElementById("list").FireEvent ("onchange")
    [/vba]
    That's great! I wonder why my code fails. The dropdown list changes value but the onchange-event doesn't trigger anything. Can you find any errors?

    [VBA]
    Sub UpdateList()
    Dim IE As Object

    lng_Sleep = 500

    Set IE = CreateObject("InternetExplorer.Application")
    IE.Visible = True
    apiShowWindow IE.hwnd, SW_SHOWMINIMIZED
    Sleep lng_Sleep
    IE.navigate "https://www.avanzabank.se/aktier/lista"

    Do
    DoEvents
    Sleep lng_Sleep
    Loop While IE.ReadyState <> READYSTATE_COMPLETE

    IE.Document.getElementById("list").selectedIndex = 8
    IE.Document.getElementById("list").FireEvent ("onchange")
    End Sub[/VBA]

    I use IE9, if it's any help.
    Last edited by Sandstedt; 11-16-2012 at 09:53 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •