View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default VBA update data from Internet Explorer and copy to Excel?

From a previous post by Jake Marx:

http://groups.google.com/groups?selm...%40tkmsftngp05

----------------------

From: Jake Marx )
Subject: Controlling IE5 from VBA in Excel 2000
View: Complete Thread (5 articles)
Original Format
Newsgroups: microsoft.public.excel.programming
Date: 2001-07-12 20:23:59 PST

Hi George,

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
--------------------- Regards,Tom Ogilvy"Mauricio Harger"
wrote in message
...
Hi,

I would like to update data from the internet automatically with VBA. I

have
already automated opening IE in the correct link with VBA. Now I need to
find the data (it is sometimes in different place) and copy to excel. Does
anybody has a routine to do it? Thanks,

--


Mauricio Harger - Brazil