getting info from web site via vba /sql

daveyc18

Well-known Member
Joined
Feb 11, 2013
Messages
707
Office Version
  1. 365
  2. 2010
so there's a certain internal web site I go to daily to get certain reports. ...I gotta log in, click this and that ...then filter for the date, then run to extract in excel then paste to the workbook

I'd obviously love vba code to extract and download the data and paste to the workbook without logging in to the web site without all the clicks...it would save time

my question is how can I write the SQL query to grab this info ? like how do people know which table to pick etc ? do I have to ask the tech support running the web site /server/ database for the info ?
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Hey

Your best bet is to get credentials from the internal DB owner, set yourself up an ODBC data source, then use power query to connect and run your query.

The owner should give you some pointers on the query to run, it would be a case of taking that and applying variables where relevant.

These are the steps I used to use when connecting to various type, Redshift, PostGres, SQLServer, Access etc.

Alternatively, next time you're manually running the process, check if the URL stores the selected variables. If so, use power query to perform a get data from Web and use the URL with those variables which can be calculated in Excel or as part of your initial query.

HTH
Dave
 
Upvote 0
Hey

Your best bet is to get credentials from the internal DB owner, set yourself up an ODBC data source, then use power query to connect and run your query.

The owner should give you some pointers on the query to run, it would be a case of taking that and applying variables where relevant.

These are the steps I used to use when connecting to various type, Redshift, PostGres, SQLServer, Access etc.

Alternatively, next time you're manually running the process, check if the URL stores the selected variables. If so, use power query to perform a get data from Web and use the URL with those variables which can be calculated in Excel or as part of your initial query.

HTH
Dave

thanks ...how would I check the url stores ? sorry not famiakr ..I'm using chrome
 
Upvote 0
If you look at the URL in the address bar, see if it have anything after the question mark (?) that looks like your selected variables. I'll be honest, most don't as it's all done on the fly, but you never know

1697828124428.png
 
Upvote 0

Forum statistics

Threads
1,215,102
Messages
6,123,097
Members
449,096
Latest member
provoking

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