Using Excel VBA to perform repetitive web browsing tasks...

sleuth

New Member
Joined
Jan 12, 2018
Messages
27
I would like to write a macro to go to an internal company website to download data and import it into my spreadsheet. The website requires me to login and do a series of mouse clicks to download the data as excel spreadsheets, for which I already have developed a macro to merge these spreadsheets and format it the way I want.

I'm new to VBA but I've done a little research. My browser options on my company PC are Chrome, Firefox, IE, or Edge. I cannot download or install any unapproved 3rd-party applications (such as Selenium for Chrome) to aid me in this, and obtaining approvals for anything are unlikely.

Based on what I've found you would need Selenium to use Chrome, and that currently Edge does not support any VBA functionality.

Looking for some advice, pointers, or online resources to help.
 
Last edited:

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
There are several approaches using VBA.

1. Automate the website using IE and MS HTML Object Library (HTMLDocument etc. classes) and Windows API functions to handle the IE file download dialogue. See the following threads for example code:

http://www.mrexcel.com/forum/excel-...ile-download-dialog-box-without-sendkeys.html - has links to other examples.
https://stackoverflow.com/questions/11638933/excel-vba-sendkeys-not-causing-ie-9-to-save-download (unfortunately the detailed pages by one of the users, Siddharth Rout, don't seem to be available any more).

2. Using UIAutomationClient. Easier than the above method.

http://www.mrexcel.com/forum/excel-...ual-basic-applications-website-accessing.html

3. Using XMLhttpRequest to send GET and/or POST requests to the website to emulate the requests that a web browser sends. This is the fastest and most flexible method, but also the most complicated.

http://www.mrexcel.com/forum/excel-...n-internet-explorer-web-site.html#post3404965
http://www.mrexcel.com/forum/excel-questions/749860-msxmlhttp-post-paramaters.html
http://www.mrexcel.com/forum/excel-...ns-automation-websites-login.html#post4324160

Being an intranet site it will be difficult to help you further.
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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