Use VBA to simulate right click on IE web page and select and option

dragon2300

New Member
Joined
Feb 28, 2016
Messages
4
Hello Excel Masters!

I am an amateur Excel enthusiast and I am attempting something very new to me: IE Automation

the website I am trying to automate is housed in an internal network, so I cannot link the specific site, but here's the gist of it:

The website is a plain site with only a Javascript coded table that gives real time stats pulled from a central server.
I want to use these stats in an excel sheet, but I don't have direct access to the central server, So I am pulling the information into excel using a connection link like this:

if I open IE to the page and right click on the element and select 'Export to Excel' if does exactly what I want it to do - I get real time stats that auto refreshes.

the problem - the Element uses a DatasetID that is randomly generated every 24 hours - so if I go to use my Excel sheet I have to re-export the page to get data again. I would really like to automate this function so that anyone could open the sheet (if connected to the internal network) and be able to get fresh live stats using the sheet.

The only way I can think of to do that is to have VBA open an instance of the website, and automate a right click (it would have to be based on mouse position instead of element ID and I can't seem to figure out what the element calls itself) and select Export to excel to the currently selected sheet (I would have the sheet wiped using VBA earlier in the code)


I have been successful in opening the page (visible for testing) and maximizing the window to make sure there's a static size, but I cant figure out how to position the mouse and right click and select the option I want.

If anyone has any ideas on a better way to do this, I am totally open, I cannot paste details about the site here though.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Forum statistics

Threads
1,215,447
Messages
6,124,909
Members
449,195
Latest member
Stevenciu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top