MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Selecting from option list on webpage

  Asked By: Colleen    Date: Feb 12    Category: MS Office    Views: 749

I'm trying to use Excel2000 VBA to control a webpage. I
can easily select by setting xList1.Value when the control's HTML
looks like this:
<select name="xList1" >
<option value="1" >Weekly</option>
<option value="2" >Two Weeks</option>
<option value="3" >Three Weeks</option>
<option value="4" selected>Four Weeks</option>

But the page I'm trying to manage also includes this control (Note the
absence of "value=" coding). I've tried using Value and ListIndex but
these don't work.
<select name="xList2" >
Which Property should I be setting? Thanks in advance for any ideas.



1 Answer Found

Answer #1    Answered By: Mona Wagner     Answered On: Feb 12

What do you thing about to use Split function?
You could try something like this:

'S <-- your form into a string
S = Replace(S, "<option>", "#")
S = Replace(S, "</option>", "")
S = Replace(S, "</select>", "")
S = Replace(S, vbNewLine, "")
S = Split(S, "#")

Then you will have an array where the values will be S(1) to S(Ubound(S)).

Didn't find what you were looking for? Find more on Selecting from option list on webpage Or get search suggestion and latest updates.