S
stillhardda
Registriert
Thread Starter
- Dabei seit
- 14.01.2016
- Beiträge
- 1
- Reaktionspunkte
- 0
Hallo zusammen
Ich habe eine Excel-VBA-Funktion auf PC erstellt (siehe unten), diese sollte nun auch auf MAC funktionieren.
Kann mir jemand helfen, wie ich die umschreiben muss oder gibt es einen Konverter?
Hier die Funktion (rot):
Public Function Entfernung _
( _
Start_Strasse As String, Start_Stadt_PLZ As String, _
Start_Bundesland As String, Start_Staat As String, _
Ziel_Strasse As String, Ziel_Stadt_PLZ As String, _
Ziel_Bundesland As String, Ziel_Staat As String _
)
Dim surl As String
Dim oXH As Object
Dim bodytxt As String
surl = "http://maps.googleapis.com/maps/api/distancematrix/xml?origins=" & _
Replace(Start_Strasse, " ", "+") & "+" & Replace(Start_Stadt_PLZ, " ", "+") & "+" & _
Replace(Start_Bundesland, " ", "+") & "+" & Replace(Start_Staat, " ", "+") & _
"&destinations=" & _
Replace(Ziel_Strasse, " ", "+") & "+" & Replace(Ziel_Stadt_PLZ, " ", "+") & "+" & _
Replace(Ziel_Bundesland, " ", "+") & "+" & Replace(Ziel_Staat, " ", "+") & _
"&mode=driving&sensor=false&units=metric"
Set oXH = CreateObject("msxml2.xmlhttp")
With oXH
.Open "get", surl, False
.send
bodytxt = .responseText
End With
bodytxt = Right(bodytxt, Len(bodytxt) - InStr(1, bodytxt, "<value>") - 5)
bodytxt = Right(bodytxt, Len(bodytxt) - InStr(1, bodytxt, "<value>") - 6)
Entfernung = Left(bodytxt, InStr(1, bodytxt, "</value>") - 1) / 1000
Set oXH = Nothing
End Function
Vielen Dank für Eure Antwort
LG Daniel
Ich habe eine Excel-VBA-Funktion auf PC erstellt (siehe unten), diese sollte nun auch auf MAC funktionieren.
Kann mir jemand helfen, wie ich die umschreiben muss oder gibt es einen Konverter?
Hier die Funktion (rot):
Public Function Entfernung _
( _
Start_Strasse As String, Start_Stadt_PLZ As String, _
Start_Bundesland As String, Start_Staat As String, _
Ziel_Strasse As String, Ziel_Stadt_PLZ As String, _
Ziel_Bundesland As String, Ziel_Staat As String _
)
Dim surl As String
Dim oXH As Object
Dim bodytxt As String
surl = "http://maps.googleapis.com/maps/api/distancematrix/xml?origins=" & _
Replace(Start_Strasse, " ", "+") & "+" & Replace(Start_Stadt_PLZ, " ", "+") & "+" & _
Replace(Start_Bundesland, " ", "+") & "+" & Replace(Start_Staat, " ", "+") & _
"&destinations=" & _
Replace(Ziel_Strasse, " ", "+") & "+" & Replace(Ziel_Stadt_PLZ, " ", "+") & "+" & _
Replace(Ziel_Bundesland, " ", "+") & "+" & Replace(Ziel_Staat, " ", "+") & _
"&mode=driving&sensor=false&units=metric"
Set oXH = CreateObject("msxml2.xmlhttp")
With oXH
.Open "get", surl, False
.send
bodytxt = .responseText
End With
bodytxt = Right(bodytxt, Len(bodytxt) - InStr(1, bodytxt, "<value>") - 5)
bodytxt = Right(bodytxt, Len(bodytxt) - InStr(1, bodytxt, "<value>") - 6)
Entfernung = Left(bodytxt, InStr(1, bodytxt, "</value>") - 1) / 1000
Set oXH = Nothing
End Function
Vielen Dank für Eure Antwort
LG Daniel