Consulting

Results 1 to 2 of 2

Thread: Solved: Combo Box Selection (SOS)

  1. #1
    VBAX Mentor
    Joined
    Oct 2007
    Posts
    357
    Location

    Question Solved: Combo Box Selection (SOS)

    Hello,

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

    Below is the code:

    [VBA]aget_List_IndexNo IE1.document.approve.dlr_id, tstr1[/VBA]

    The above code will call the below procedure:

    [VBA]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
    [/VBA]

    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 [VBA]IE1.document.approve.dlr_id.Click[/VBA]

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

    I am doing all this coding in excel 2003.



    Any help regarding this is appreciated.

    Thanks
    Sudhir

  2. #2
    VBAX Regular
    Joined
    Jul 2008
    Location
    Cincinnati, OH
    Posts
    86
    Location
    Hello Sudhir. Please post the table's source code.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •