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
Hmmm - I do not receive that error. In fact, I do not receive an error at all. From what I have found so far, I need to somehow set "something".selected = True rather than using HTMLtag.Click.
It appears that you are using Java Script and I don't know a lot about Java Script.
However, from the error I got it appears that when you click on Export File it executes line 25 which is: parent.PickListPanel.location.href = URL; and above that you have:
var URL = form.options[form.selectedIndex].value; which is the value of the index of the selected form. But it doesn't appear that you have anything in your If statement after parent.PickListPanel.location.href = URL that is related to Export File.
I really don't know, but I think your problem is in the way you are trying to reference the link you wnat to go to when Export File is clicked.
Why can't you just write an HTML link tag for each item in the drop-down menu?
Or use somethin like this:
I just noticed in your original posting you have a For/Next loop in visual Basic. However in the code in your attached file (Text.txt) you are using Java Script.
Maybe I am confused about what you are trying to do?????
I am trying to interact with this webpage through VB. The reason why I attached the HTML source code of this page was to aid in any debugging. From my understanding of the WebBrowser Control, I can use the HTML in the page to call events like a Click event. I'm in the same boat, I do not know too mucj about this either.
Maybe you would have better luck if you posted this in the Classic Visual Basic forum or maybe you already had it there since you stated: "apologize for the cross post ... "