• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA IE change dropdown value

TahorSuiJuris

New Member
Tried the below code for the following URL http://ebible.org/study/

Please how to change drop down value from WEB to RV1909
Screenshot of Chrome Inspector https://i.stack.imgur.com/rRtP8.png

Code:
Dim Doc As HTMLDocument
Set Doc = IEApp.document

TestV2 = ""
TestV3 = ""

TestV2 = Doc.getElementsByClassName("app-list text-list")(0).innerText
Debug.Print "4b of 5: " & TestV2   

IEApp.Doc.getElementsByClassName("app-list text-list").selectedIndex = 1
IEApp.Doc.getElementsByClassName("app-list text-list").FireEvent ("onchange")

TestV3 = Doc.getElementsByClassName("app-list text-list")(0).innerText
Debug.Print "4c of 5: " & TestV3
 
Did you try Testv2.selectedIndex = 2
You will have to check which number represents the text you require in the drop down list.
 
Back
Top