Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

running excel web query with password protected webpages

Status
Not open for further replies.

Ryan2028

Technical User
Jul 6, 2006
1
US
hey everyone,
I am trying to import data into Excel from a webpage using the web query function; however, the webpage requires a login and password. I have the required login and password, but I cannot figure out how to make excel automatically input these into the correct fields and login in order to import the data.

Since I am trying to make all of our databases update automatically, I don't want to enter this info everyday when the macro runs.

Any suggestions?
Thanks

Ryan
 
Ryan2028,
I haven't seen a way to do this when using a WebQuery. In my experience most sites require a login to create a session ID, then you get directed to the page were the data is, and Excel dosn't offer a mechanism to navigate a page before grabbing data.

I have done stuff like this using a WebBrowser control embedded in a UserForm. This allows you to create sessions and navigate pages with code, but it's not pretty. Below are a couple links that might be of interest to you.

Here is an example of how to navigate by emulating an HTML form:
[navy]Microsoft: Access Modules (VBA Coding) Forum:[/navy] Exporting Data to a internet form

Here is an example of using the WebBrowser control to navigate to web page, pull the data table and save as a local file, parse data from the local file into an array...
[navy]Microsoft: Access Modules (VBA Coding) Forum:[/navy] Importing Information from the Internet

Here is a source from Microsoft on using the WebBrowser control.
[navy]MSDN:[/navy] Developing Integrated Office Solutions, Part 2

Hope this helps,
CMP

(GMT-07:00) Mountain Time (US & Canada)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top