Hello, I am trying to click on a specific option in a drop down on an IE page and I am having trouble with this code. As of now this is the code I have to access the page.
Dim HTMLDoc As HTMLDocument
Dim MyBrowser As InternetExplorer
Sub MCLogin()
Dim MyHTML_Element As IHTMLElement
Dim MyURL As String
On Error GoTo Err_Clear
MyURL = "***********"
Set MyBrowser = New InternetExplorer
MyBrowser.Silent = True
MyBrowser.navigate MyURL
MyBrowser.Visible = True
Do
DoEvents
Loop Until MyBrowser.readyState = 4
Set HTMLDoc = MyBrowser.document
HTMLDoc.all.txtLogonID.Value = "*******"
HTMLDoc.all.txtPswd.Value = "*********"
For Each MyHTML_Element In HTMLDoc.getElementsByTagName("input")
If MyHTML_Element.Type = "submit" Then MyHTML_Element.Click: Exit For
Next
Err_Clear:
If Err <> 0 Then
Err.Clear
Resume Next
End If
Resume Next
End Sub
Now I need to click on a drop down and select an option from a list(in the same window.) Here is the HTML for the Dropdown box.
Can anyone get me moving in the right direction on this project?
Thanks! John
Bookmarks