Dim i As Integer
i = Val(Application.Version)
#If i > 11 Then
'Befehle, die es erst ab Excel 2007 gibt
#End If
Gruß von LuschiFunction Entfernung(ByVal von As String, ByVal bis As String) As String
Dim arText As Variant
Dim IEApp As Object
Dim i As Long
Dim start As String
Dim ziel As String
Set IEApp = CreateObject("InternetExplorer.Application")
IEApp.Visible = True
IEApp.Navigate "http://maps.google.com/maps?saddr=" & von & "&daddr=" & bis & "&hl=de&output= _
html"
'Application.Wait (Now + TimeValue("0:00:5"))
Do: Loop Until IEApp.Busy = False
While True
arText = Split(IEApp.Document.Body.innerText, vbCrLf)
For i = 0 To UBound(arText)
If InStr(1, arText(i), "km – ca.", vbTextCompare) > 0 Then
Entfernung = arText(i)
Exit Function
End If
Next
MsgBox "Bitte Route im IE manuell korrigieren"
Wend
End Function
Hoffe es hilft,arText = Split(IEApp.Document.Body.innerText, vbCrLf)
....
If Instr(IEApp.Document.Body.innerText, "MeinSuchtext") > 0 Then MsgBox "Text vorhanden"
Nochmals vielen Dank - hast mir sehr geholfen.