Ich möchte auf einer Homepage die versionsnummer des Datenblattes abfragen!
Homepage: http://www.glstanks.com/de/datenblaetter.html
ICh habe mir gedacht ich speichere eine temporäre txt-Datei und lese die Versionsnummer aus!
Bei Win7 funktioniert es auch! Bei XP jedoch nur mit Haltepunken! Bei XP blinkt das Worksheet und das makro wird erst zu ende ausgeführt wenn ich irgenwo im Tabellenblatt hineinklicke!
Vielleicht habt ihr auch eine andere (elegantere) Lösung für mich...
ich bin leider kein Profi!
Sub Versionsprüfung()
Call URL_Load("http://www.glstanks.com/de/datenblaetter.html")
End Sub
Sub URL_Load(ByVal sURL As String)
Dim Dateipfad As String
Dateipfad = ThisWorkbook.Path & "\" & ThisWorkbook.Name
Dim Textdatei As String
Textdatei = ThisWorkbook.Path & "\test.txt"
Dim text As String
Dim textline As String
Dim posLat As Integer
Dim posLong As Integer
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 Textdatei For Output As #1
Print #1, sTxt
Close
Open Textdatei For Input As #1
Do While Not EOF(1)
Line Input #1, textline
text = text & textline
Loop
Close #1
posLat = InStr(text, "Tankwand")
Application.Wait Now + TimeValue("0:00:03")
MsgBox ("Tankwand: " & Mid(text, posLat + 16, 6))
End Sub
LG Mario
|