views:

30

answers:

1

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?

A: 

Like this:

ie.window.exportData(ie.document.forms.workOrderSearchForm)
SLaks
Unfortunately it says that's not a supported method or property. It also spaces the code as such "ie.Window.exportData (ie.Document.forms.workOrderSearchForm)" once I put it in.
Michael
Try `ie.window.exportData ie.window.workOrderSearchForm` or `ie.window.eval "exportData(workOrderSearchForm)"`
SLaks
Neither of those seem to do the trick, either. They produce the same error.
Michael