Dad_x6
Board Regular
- Joined
- Jan 15, 2013
- Messages
- 89
I am trying to select from a dropdown in IE from Access VBA. You cannot right click on the dropdown and inspect element. I ended up using something on found online, and it worked for a while, but it has now stopped working. Here is what I was using...
If I remember correctly, the error that occured is that it could not find the object (presumably the IE control that is referenced).
I then found another way to find that dropdown, and it appears that it is a control called selectResult (see the HTML below).
So... The problem is that I am having trouble connecting to the IE control (the dropdown box). Then, when I connect to it, I need to be able to select the csv option (which I'm assuming is option 4 if zero based).
Code:
IEWindow.Document.querySelector("div[id=pagecontents] div[class=container] div[id=resultOptions] form[name=resultOptions] select[id=selectResult]").Focus
IEWindow.Document.querySelector("div[id=pagecontents] div[class=container] div[id=resultOptions] form[name=resultOptions] select[id=selectResult]").selectedIndex = 4
IEWindow.Document.querySelector("div[id=pagecontents] div[class=container] div[id=resultOptions] form[name=resultOptions] select[id=selectResult]").dispatchEvent evt
If I remember correctly, the error that occured is that it could not find the object (presumably the IE control that is referenced).
I then found another way to find that dropdown, and it appears that it is a control called selectResult (see the HTML below).
HTML:
- Choose -Store these results in a new C_Merge these results with an ex_Replace an existing ChartList _Download In CSV Format
So... The problem is that I am having trouble connecting to the IE control (the dropdown box). Then, when I connect to it, I need to be able to select the csv option (which I'm assuming is option 4 if zero based).