Hi all, this has been puzzling me for a day. What I want to do is select other options in IE html drop down list. But somehow the other methods I read online doesn't work with my situation. I got either "Variable or Block Variable not set yet" or "Property or Method doesn't apply" errors. The following is the VBA code I have so far:
Sub IE_Auto()
Dim IE As Object
Dim IE_Object As Object
Dim IE_Element As Object
Dim IE_Select As Object
Dim IE_Value As Object
Dim i As Integer
Set IE = CreateObject("INTERNETEXPLORER.APPLICATION")
IE.navigate "my web address"
IE.Visible = True
Do While IE.Busy: DoEvents: Loop
Do While IE.readyState <> 4: DoEvents: Loop
Set IE_Object = IE.document.getElementsByTagName("input")
i = 0
Do While i < IE_Object.Length
If IE_Object(i).Name = "username" Then
IE_Object(i).Value = "my username"
ElseIf IE_Object(i).Name = "password" Then
IE_Object(i).Value = "my password"
ElseIf IE_Object(i).Type = "image" Then
IE_Object(i).Click
Exit Do
End If
i = i + 1
Loop
Do While IE.Busy: DoEvents: Loop
Do While IE.readyState <> 4: DoEvents: Loop
******************************
This is where I need your help
******************************
End Sub
and the following is html code of the web page:
I tried IE.document.getElementByName("dxr_report").Value = "file2" to choose the file2 but failed
I also tried IE.document.all.Item("dxr_report").Vaule = "file2", doesn't work either.
Any Idea? Please help! Thanks in advance
Bookmarks