Parsing Data From HTML Source into Excel using VBA

  • Thread starter Thread starter Peter Dickson
  • Start date Start date
P

Peter Dickson

I am trying to parse some data from some HTML web pages using VBA for Excel
(2002) but cannot
remember the function to open the web pages and assign the source info to a
variable in VBA. Does anyone know how to do this?

Thanks
 
Set IE = CreateObject("InternetExplorer.Application")
IE.navigate "http://www.yahoo.com" 'place your desired URL here
IE.Visible = True 'if you want to see the browser window, but not
necessary
While IE.Busy
DoEvents
Wend
x = IE.document.body.innerHTML
IE.Quit
'now the HTML code BODY your looking for is in the variable x

you will need to add a reference to the msinet.ocx before using

Lynn S
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top