1 Attachment(s)
[RESOLVED] Select list item?
Apologize for the cross post but, I think this issue should fall here.
Please see attached HTML file for source code:
On the webpage, there is a option called "MANAGE ANALYTICS" that I want to click on first, then a drop down list appears and I want to select "Export File" to take me to the next page. However, the HTMLtag.click is failing. (No errors though, it just doesn't work) Anyone see what I am doing wrong?
Thanks,
J
VB Code:
For i = 0 To WebBrowser.Document.frames.length - 1
For Each HTMLtag In WebBrowser.Document.frames(i).Document.All
Select Case HTMLtag.tagName
Case "SELECT"
If HTMLtag.getAttribute("name") = "Admin" Then
For v = 0 To HTMLtag.children.length - 1
If Trim(HTMLtag.children(v).innerText) = Trim("MANAGE ANALYTICS") Then
HTMLtag.Click
If Trim(HTMLtag.children(v).innerText) = Trim("Export File") Then
HTMLtag.Click
End If
End If
Next
End If
End Select
Next
Next
[RESOLVED]: Select list item?
Got it to work using this:
VB Code:
Set selectElem = WebBrowser.Document.getElementsByTagName("SELECT")
For i = 0 To selectElem.length - 1
If selectElem(i).Name = "Admin" Then
For v = 0 To selectElem(i).Options.length - 1
Set opt = selectElem(i).Options(v)
If opt.Text = "Export File" Then
opt.Selected = True
End If
Next v
End If
Next i