AW: suche Beispiele html <-> xls
26.12.2003 11:29:39
Nepumuk
Hallo Vera,
ein Beispiel wie die Zeile 20 bis 25 von eine Site in eine Exceltabelle geschrieben werden.
Option Explicit
Public Sub Aufruf()
Call URL_Load("http://www.kicker.de")
End Sub
Private Sub URL_Load(ByVal sURL As String)
Dim appIE As Object, lfCount As Integer, txtSearch As Long
Dim sTxt As String, txtLine As String, txtbool As Boolean
Dim lngZeile As Long
Set appIE = CreateObject("InternetExplorer.Application")
appIE.navigate sURL
Do: Loop Until appIE.Busy = False
Do: Loop Until appIE.Busy = False
sTxt = appIE.document.documentElement.outerTEXT
Set appIE = Nothing
lfCount = 1
For txtSearch = 1 To Len(sTxt)
If txtbool Then
If Mid(sTxt, txtSearch, 1) = vbCr Then
lngZeile = lngZeile + 1
Cells(lngZeile, 1) = txtLine
txtLine = ""
txtbool = False
Else
txtLine = txtLine & Mid(sTxt, txtSearch, 1)
End If
Else
If Mid(sTxt, txtSearch, 1) = vbLf Then lfCount = lfCount + 1
Select Case lfCount
Case 20 To 25: txtbool = True 'Zeile 20 bis 25
End Select
End If
Next
MsgBox "Fertig"
End Sub
Code eingefügt mit: Excel Code Jeanie
Gruß
Nepumuk