I'm trying to get my VBA routine to interact with a page that uses JavaScript, and have been successful in the past. After a recent update, it no longer works. At this point I need to either A) programmatically click a button or B) execute the function the button calls. The tricky part is that the button has no declared name. There are others on the sheet declared in the source code with names, and I can interact with them just fine. Here's the html code from the page source:
<input type="button" class="buttonForm" value='Run Report' onclick="exportData(workOrderSearchForm)"/>
As you can see, it does not declare a name for the button. In the past, the following has worked:
Set ie = CreateObject("InternetExplorer.application")
ie.document.all(79).Click
With "79" being the index of the item number. It now appears that the button has been changed to item "81", but simply putting in:
ie.document.all(81).Click
is not working for some reason. I know the function I want to execute: exportData(workOrderSearchForm), but don't know how to do so outside of using the "click" method.
I've looked for some decent documentation regarding the IE application object, but can't seem to find a good source. Is there a way to execute the function?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…