Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting multiple values in alistbox on a webpage

Status
Not open for further replies.

JiggyPiggy

Programmer
Feb 3, 2005
5
CA
I have been able to complete webforms through VBA and Excel data using something like...

Dim HTMLBoxDoc as HTMLDocument

HTMLBoxDoc.forms("form1").Item(itemname in site code).value = whatever i want it to be
'Submit the page
HTMLBoxDoc.forms("form1").Submit

The issue I am having is when the site contains a listbox. I can select one item from the list box (using the value code from the source instead of the displayed value) but I cannot figure out how to select multiple items from the list box (it is a multi listbox) through code. I would really prefer not to have to use SendKeys.
 
K, guess I am an idiot.

HTMLBoxDoc.forms("form1").Item(lstbox name).item(which item I want).selected = true

Then the same code with the next item.selected = true works nice and easy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top