At the MINIMUM I want to tell IE5 to "Select All" and then to "Copy" to the
clipboard. I already have operational VBA code that pastes the text from
the web page into a worksheet and then picks out the info I desire.
At the MAXIMUM I want to invoke an instance of IE5 from VBA in Excel. Give
IE5 the commands necessary to get the web page I want into IE5, and then do
the MINIMUM mentioned above.
Someone must have written some really good stuff on this subject, since it
seems quite useful.
Thanx in advance,
George Stevens
Here's a function that will grab the text of a web page for you:
Function sGetURLText(sURL As String) As String
Dim ie As Object
Set ie = CreateObject("InternetExplorer.Application")
ie.Navigate sURL
Do Until ie.ReadyState = 4
DoEvents
Loop
sGetURLText = ie.Document.Body.InnerText
If InStr(1, sGetURLText, "The page cannot be displayed", _
vbTextCompare) Then sGetURLText = ""
ie.Quit
Set ie = Nothing
End Function
Just pass in the URL as an argument, and the function will return either an
empty string (invalid URL) or the text of the page. Hopefully this will do
what you were looking for.
Regards,
Jake Marx
"George Stevens" <sdge...@ix.netcom.com> wrote in message
news:OrMZhf0CBHA.1940@tkmsftngp05...
Public Sub WebCopy()
Dim IE As InternetExplorer
Set IE = New InternetExplorer
With IE
.Navigate "www.care4free.net"
.Visible = True
Do While .Busy
' Do nothing
Loop
.ExecWB OLECMDID_SELECTALL, OLECMDEXECOPT_DONTPROMPTUSER
.ExecWB OLECMDID_COPY, OLECMDEXECOPT_DONTPROMPTUSER
End With
Set IE = Nothing
End Sub
HTH, Jamie.
"George Stevens" <sdge...@ix.netcom.com> wrote in message news:<OrMZhf0CBHA.1940@tkmsftngp05>...
"George Stevens" <sdge...@ix.netcom.com> wrote in message news:<OrMZhf0CBHA.1940@tkmsftngp05>...
--
Jeff McAhren
Dallas, Texas
"George Stevens" <sdge...@ix.netcom.com> wrote in message
news:OrMZhf0CBHA.1940@tkmsftngp05...