PDA

View Full Version : Parse data from Excel to IE using VBA



AdriPaul
04-09-2012, 09:14 AM
Dear All,

I am trying to parse some data from an Excel sheet to an IE page using VBA and I have difficulties in sending data to one object that look like a special combobox.

In fact there are 2 comboboxes on that particular page define as following:
- Combobox 1: <select name="material[]"><option value="3">AL</option><option value="2">TL</option><option value="1">GL</option>

- Combobox 2:
<

div class="ui-widget">

<

select name="partner" id="ID" style="width:300px">

<

option value="no"></option>

<
option value="3766">COMPANY 1</option><option value="3792">COMPANY 2</option><option value="3764">COMPANY 3</option><option value="3071">COMPANY 4</option>

While I can send the data to combobox 1 using the following code:
IE.document.all.Item("material[]").selectedIndex = "2"

it seems that the same code doesn't function on the second combobox:
IE.document.all.Item("partner").selectedIndex = "3766"

and no data is displayed (nor trigger any errors).

Do you have any ideas how could I accomplish this?

Thanks,
Adrian