Open saved web page with ie

S

shockley

How do I open a saved webpage (eg, saved on my desktop) with Internet
Explorer using vb code? I want to be able to get the list of links from the
page.

I thought maybe I could use a shdocvw command, but not sure where to go with
it. Is there a Help source anywhere for this library?

Dim IE As New InternetExplorer
ie.ExecWB(OLECMDID_OPEN, ??
 
J

Jake Marx

Hi shockley,

If you want to use IE only, then something like this should work (requires
reference to shdocvw):

Dim ie As InternetExplorer

Set ie = New InternetExplorer

With ie
.Navigate URL:="c:\documents and settings\jmarx\desktop\test.htm"
Do While .Busy And Not .ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
.Visible = True
End With

Set ie = Nothing

Alternatively, you can use the built-in FollowHyperlink method:

ThisWorkbook.FollowHyperlink "c:\documents and
settings\jmarx\desktop\test.htm"

Regards,

Jake Marx
MS MVP - Excel
 

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

Similar Threads


Top