Ying
There are a few ways to get the text of a webpage programmatically via VBA.
Here's one method I posted recently to the excel.programming NG:
Private 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
Here's another method posted by Mark Durrett in the excel.programming NG.
To use this, you must set a reference to the Microsoft XML 2.x Object
Library (via Tools | References in VBE):
Private Sub Command1_Click()
Dim xmlhttp As MSXML2.xmlhttp
Dim s As String
Dim i As Integer
Set xmlhttp = CreateObject("MSXML2.XMLHTTP")
xmlhttp.open "GET", "http://www.microsoft.com"
xmlhttp.send
s = xmlhttp.responseText
i = InStr(1, s, "Last Updated: ")
Debug.Print Mid(s, i + 14, InStr(i, s, "<") - i - 14)
End Sub
I haven't tried this one myself, but it looks like it should work well.
Regards,
Jake Marx
"Fluitekruid" <fluit...@zeelandnet.nl> wrote in message
news:3b575bfa$0$16...@news2.zeelandnet.nl...
Thanks for your help. It works.
Where can I get more the information about the properties of the object
"internetexplorer" and other objects like worksheet? Can you advise me some
websites or books?
Greetings,
Ying
"Jake Marx" <ja...@longhead.com> schreef in bericht
news:#TCm4FLEBHA.580@tkmsftngp07...