Ann
Ann

Reputation: 31

Select an option from combo box on webpage with vba'

I'm developing a macro to automate work item creations in VBA using Internet explorer , I Need to automate selecting an options "customer " from combo box drop down , since the options are in list and the script is a bit confusing could you please help me with the correct VB command to select the "Customer" option.

I have tried the following nothing seems to work

'.getElementById("com_ibm_team_workitem_web_mvvm_view_queryable_combo_QueryableSection_QueryableElement_323").Select
   ' .getElementsByClassName("ValueHolder ViewBorder")("SectionElementImage sprite-image-40").Select
   ' .getElementsByClassName("ValueLabelHolder")(2).selectelement.DropDowns("SectionElementImage sprite-image-42").Value
    '.selectElement.DropDowns("DropDown1").Value
    '.getElementByClassid("ValueHolder ViewBorder").selectedIndex = 1
    '.getElementsByClassid("com_ibm_team_workitem_web_mvvm_view_queryable_combo_QueryableSection_QueryableElement_359").Value
    '.SendKeys ("{Enter}"

HTML code and website image

Upvotes: 0

Views: 436

Answers (1)

Hiran Travassos
Hiran Travassos

Reputation: 27

You might wanna try something like this

ie.Document.getElementById("ComboBox").selectedIndex = 2

Being selectedIndex your 1,2,3 index of the combobox.

Upvotes: 0

Related Questions