Gruppe
Extern
Problem
Eine Internet-HTML-Seite soll ausgelesen und als Textdatei im Verzeichnis dieser Arbeitsmappe gespeichert werden.
StandardModule: Modul1
Sub Aufruf()
Call URL_Load("http://www.kicker.de")
End Sub
Private Sub URL_Load(ByVal sURL As String)
Dim appIE As Object
Dim sTxt As String
Set appIE = CreateObject("InternetExplorer.Application")
appIE.navigate sURL
Do: Loop Until appIE.Busy = False
Do: Loop Until appIE.Busy = False
sTxt = appIE.document.documentElement.outerHTML
Set appIE = Nothing
Close
Open ThisWorkbook.Path & "\test.txt" For Output As #1
Print #1, sTxt
Close
MsgBox "Der Text wurde gespeichert unter:" & vbLf & _
Application.Path & "\test.txt"
End Sub