Activating javascript with excel

G

Guest

I have a problem where I want to access a website, run a query on that
particular page of the website by activating buttons displayed on the web
page and then activate a javascript command to export the data to excel. I
am using Excel 2003 Professional. Is there any way possible of automating my
problem.
 
R

Randy Harmelink

Might be possible. But it would depend entirely upon the details.
What web page are you trying to automate?
 
T

Tim Williams

If you're using the web page directly how do you run the Excel export ?
Button? Link?

Tim
 
G

Guest

Tim,

The button to pull up the list of queries in the web source code is :

<input class="button" id="btnLoad" style="WIDTH: 75px"
onclick="javascript:loadQuery();"type="button" value="Load">

Followed by a link to export to an excel spreadsheet :

<br>--><a id="hlExport" href="javascript:exportExcel();">Export to
Excel</a><br>

The excel spreadsheet created always has the same name so that would be the
easy part, it's just the two parts in the automation process above that has
got me stumped.

Many Thanks
 
G

Guest

Randy,

Unfortunately, i'ts restricted to the company I work for but the gist of
what I need to do is in the reply to Tim.

Regards--
jason36
 
T

Tim Williams

For the button this should work:
IE.document.getElementById("btnLoad").click

Where IE is your reference to the browser app.


For the link this might also work:
IE.document.getElementById("hlExport").click

....but it really depends on what happens in the js 'exportExcel()' function.

Tim
 
G

Guest

Tim,

Many Thanks

It worked like a dream. I may have another small issue, if so I'll title it
Activating Javascript 2

Thanks again
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top