PDA

View Full Version : Solved: Combo Box Selection (SOS)



kbsudhir
07-15-2008, 08:06 AM
Hello,

I have to select a value in a webpage which has 10combo boxes in a table.

Below is the code:

aget_List_IndexNo IE1.document.approve.dlr_id, tstr1

The above code will call the below procedure:

Sub aget_List_IndexNo(ByRef Ctrl_ref As HTMLSelectElement, tstr As String)
Dim ti As Integer
Dim tctrl As MSHTML.HTMLOptionElement
Application.Wait (2000)
For ti = 0 To Ctrl_ref.Length - 1
Set tctrl = Ctrl_ref.getElementsByTagName("OPTION").Item(ti)
If tstr = tctrl.Text Then
tctrl.Selected = True
Exit Sub
End If
Next
End Sub


All this was working fine but once I got combo boxes in a with same name on the same page in a table. Its giving me "Type Mismatch" error. :( :(

And in IE1.document.approve.dlr_id.Click

I am getting error - "Object dosen't support this property or method" :think: :think:

I am doing all this coding in excel 2003.

:banghead: :banghead:

Any help regarding this is appreciated.

Thanks
Sudhir

TomSchreiner
07-20-2008, 11:12 PM
Hello Sudhir. Please post the table's source code.