VBA import data from URL

novitaun

New Member
Joined
Dec 9, 2009
Messages
7
Hello all. I'm the new official noooob :)

Any idea of how to retreive information from a page using excel macros? The connection is done via SSL with login and pasword. The url is something like: http://..........&NQUSER=xxx&NQPASSWORD=XXX
I'd need to import for each of 18 different url's 9 different tables





Things I already tried:
  • Get external data from Web. I tried this enhancement already but faliled to retreive all the information. I have to say it works fine for 1 or 2 queries. Non the less, when further queries are done the older get jammed up. So you get a message which reads something like "failed to retreive data from data source"<QUERY datasource from data retreive to failed>. If you reedit the old queries, the newer URLs have replace old ones and so the query fails. :eek:
  • I also tried to use the Oracle BI plugin for Microsoft Office. It works partialy right. When retreiving data from a pivot table, it fails, and preprocessed figures aren't calculated the way they should, so numbers just don't match. :confused:
So in the end I decided to make my own macro to be able to retreive this information by myself. The problem is I don't know where to start from. Is there a way to download the html source from a page with macros? If there is I'd need to parse the html code in order to get each of the different tables held in the page.

I have already done som reaserch on this area. This is what I found:
Code:
Function GetSourcePage(ByVal url As String) As String
Dim IEapp As Object
Set IEapp = CreateObject("InternetExplorer.Application")
IEapp.Navigate url
While IEapp.Busy
    DoEvents
Wend
GetSourcePage = IEapp.Document.DocumentElement.outerHTML
IEapp.Quit
Set IEapp = Nothing
End Function


I have to say I've some experience with vba excel macros. I'd say I'm a normal vba user. I also have some vb.net knowledge
 
Last edited:

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Forum statistics

Threads
1,215,220
Messages
6,123,698
Members
449,117
Latest member
Aaagu

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