Home > Forum Home > Automating Data Analysis Tasks > Web Query with Session ID Variable | Share |
Forum Topic | Post Reply Login |
Web Query With Session Id Variable | Rate this: (3/5 from 1 vote) |
Following a previous post for automating a login to download data with a web query with VBA here, the issue was raised where the web page in question requires a session ID variable to accompany the login details. This scenario is common with .NET ASPX pages in order to authenticate the user. A solution is to first recuperate the HTML of the web page to post the variables to, extract the session ID value using string manipulation and then attach the session ID value to the web query parameters. To get the form names required for the code, it is necessary to visit the web page in question and view the source HTML. The form tags begin with "<input.." and it is the "name" attribute that needs to be used. VBA Code:
Note that this code relies on Internet Explorer. To use another browser, the Shell command can be used to replace the code CreateObject("InternetExplorer.Application"). | |||
Excel Business Forums Administrator | |||
Posted by Excel Helper on |
Replies - Displaying 1 to 1 of 1 | Order Replies By: Most recent | Chronological | Highest Rated |
Rate this: (3/5 from 1 vote) I open my Excel-spreadsheet and paste in the VBA-code. When I run the macro and debug it is a success. But I only receive the 3 text strings from the login-page in the spreadsheet. ( "Username", "Password" and "Remember my login" ) I don't get the actual data from the MyUrl (the webpage behind the login) Please help? //Mads... | |
Best Regards | |
Posted by madsing on |
Displaying page 1 of 1 |
Find relevant Excel templates and add-ins for Web Query with Session ID Variable in the Excel Business Solutions Directory |