Need help with a simple problem

  • Thread starter Thread starter Gary
  • Start date Start date
G

Gary

I need some help controlling IE(6) from Excel(2003).

All I want to do(via Excel VB) is:

1. Open a URL with IE. (Via URL or hyperlink in a cell, sheet has both)

2. Save as a .MHT or .TXT file for further processing.

3. Close IE.

Can some kind soul out there throw me a code snippet or two?
 
Gary,
Here is one example which you can modify to suit........
set up the navigate text string which could be cell contents or any other
text
use the IE DOM to select the parts of the pages you require, here I use the
body.innertext.

Cheers
N


Sub GetUrl()
Dim ie As Object
Dim s As String

Set ie = CreateObject("InternetExplorer.Application")

With ie
.Navigate "http://www.etc.etc"
Do Until Not .Busy And .ReadyState = 4
DoEvents
Loop

s = ie.Document.body.innertext 's now contains content of
webpage
.Quit
End With
Set ie = Nothing
 
Thanks Nigel, that gets me part of the way there.

Any idea how to do a <File><Save As> in IE?
 
Back
Top