Save local copy of webpages
Perhaps information from this previous post will help:
--------------------------------------
In a previous post by Jake Marx, he showed
Sub Demo()
Dim ie As Object
Dim nFile As Integer
Set ie = CreateObject("InternetExplorer.Application")
With ie
.Visible = False
.Silent = True
.Navigate "www.yahoo.com"
Do Until Not .Busy
DoEvents
Loop
nFile = FreeFile
Open "D:\yahoo.txt" For Output Shared As #nFile
Print #nFile, .Document.DocumentElement.InnerText
Close #nFile
.Quit
End With
Set ie = Nothing
End Sub
Using .Document.DocumentElement.InnerText
This did work for me with an open page in IE
Sub Tester1()
Dim IE As Object
Dim sHTML As String
Set IE = GetObject(, "InternetExplorer.Application")
IE.Visible = True
sHTML = IE.Document.Documentelement.innerText
Debug.Print sHTML
Set IE = Nothing
End Sub
--
Regards,
Tom Ogilvy
"Graham Standring" wrote in message
...
I wish to automate the saving of local copies of webpages using Excel,
and would appreciate any help.
The main requirement I have, (and this is what makes it difficult), is
to do it without having to import or open the webpage into Excel first
as this seems to upset the formatting of the page.
I intend to do this with a number of internet webpages for which the
URLs will be contained in a number of cells in a worksheet. The
webpages are mostly text and I am not bothered about saving a local copy
of any graphics that might exist on the pages.
Does anybody know if it is actually possible to do this, and if so can
you give me any help with the VBA code?
I am using Excel 2002 (SP3) on Windows XP (SP1) and have IE6 installed.
Thanks,
Graham
|