MS Excel Web Query, using existing IE instead of opening a new instance of IE?
Posted on 2011-02-17
With Microsoft Excel 2003, using the "Web Query" feature, I record a macro, put the URL of the website into the New Web Query and that opens a new instance of Internet Explorer. Using the Web Query, I go to a specific table within the tables on the web page and select the table that I want to get the data from and the Web Query copies the data and pastes it into Excel. The website that I am getting the data from requires a login and password. I wrote some VBA code to send the username and password and that works at first, however, if I use this web query several times in one day and after using the Web Query several times, I am logged into that website many times and I begin getting error messages and the Web Query does not grab any data.
Is it possible for the Web Query to to switch to the existing, already opened and logged into IE and grab that data and paste it into Excel, instead of opening a new browser window every time the query is run?
Or, if that is not possible, is it possible, to run the macro that uses the login and password, but then, after copying the data, have the query automatically logout and close the new instance of IE?