Gruppe
Allgemein
Problem
Ein Musterdepot der ComDirekt-Bank soll ausgelesen werden. Bitte beachten, dass sich der Seitenaufbau bei ComDirekt ändern kann und somit Fehler bei der Datenerfassung auftreten können.
StandardModule: Modul1
Sub Aufruf()
Call URL_Load("https://isht.comdirect.de/html/musterdepot/main.html?sPage=overview&iDepotId=1")
End Sub
Private Sub URL_Load(ByVal sURL As String)
Dim appIE As Object
Dim iCounter As Integer
Dim iRow As Integer
Dim sTxt As String
Dim bln As Boolean
Columns(1).ClearContents
Set appIE = CreateObject("InternetExplorer.Application")
appIE.navigate sURL
Do: Loop Until appIE.Busy = False
Do: Loop Until appIE.Busy = False
appIE.navigate sURL
Do: Loop Until appIE.Busy = False
Do: Loop Until appIE.Busy = False
sTxt = appIE.document.documentElement.innertext
Set appIE = Nothing
Close
Open Application.Path & "\test.txt" For Output As #1
Print #1, sTxt
Close
Open Application.Path & "\test.txt" For Input As #1
Do Until EOF(1)
iCounter = iCounter + 1
Line Input #1, sTxt
If iCounter > 41 And iCounter < 52 Then
iRow = iRow + 1
Cells(iRow, 1).Value = sTxt
End If
Loop
Close
Kill Application.Path & "\test.txt"
End Sub