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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel VBA -- retrieving info from Internet Explorer

Status
Not open for further replies.

msather

Technical User
Jan 23, 2002
3
US
Using Excel VBA, I can open up an IE window that displays the link I need, but I'm really struggling with how to retrieve any or all of the contents of the IE window.

In the Object Browser for Microsoft Internet Controls, it shows an "Internet Explorer" class with a member called "Document", but I can't seem to manipulate the contents of "Document".

I'm also confused because in the class window of the Object Browser, it shows something called "OLECMDID" that appears to have members that would allow for control of the IE window (SelectAll, Copy, Find, etc). Unfortunately, I can't figure out how to use these in my VBA code.

Any help would be appreciated.
 
Try this:
set oie = CreateObject("InternetExplorer.Application")
oie.navigate(url_string_you_supply)
set odoc = oie.document
set obody = odoc.body
myhtmlstring = obody.innerhtml
mytxtstring = obody.innertext
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top