Live-Forum - Die aktuellen Beiträge
Datum
Titel
28.03.2024 21:12:36
28.03.2024 18:31:49
Anzeige
Archiv - Navigation
1468to1472
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
Inhaltsverzeichnis

VBA-Funktion in Excel läuft nicht auf MAC-Computer

VBA-Funktion in Excel läuft nicht auf MAC-Computer
16.01.2016 17:36:33
Daniel
Hallo zusammen
Folgendes VBA-Funktion in Excel mit PC erstellt läuft nicht auf einem MAC-Computer, wer kann mir da weiterhelfen, bin VBA-Anfänger.
Brauche dringend die Übersetzung für den MAC, vielen Dank!!!
Hier ist die VBA-Funktion:
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, "") - 5)
bodytxt = Right(bodytxt, Len(bodytxt) - InStr(1, bodytxt, "") - 6)
Entfernung = Left(bodytxt, InStr(1, bodytxt, "") - 1) / 1000
Set oXH = Nothing
End Function

Vielen Dank für Eure Hilfe!

1
Beitrag zum Forumthread
Beitrag zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
wegen "msxml2.xmlhttp" - Mac-Pendant?
16.01.2016 17:47:37
Michael
Hi Daniel,
das liegt an dem msxml2.xmlhttp, das ist der Aufruf einer Windows-Funktion, die naturgemäß auf Mac nicht funktionieren *kann*, weil da halt kein Windows läuft.
Evtl. kannst Du unter Daten/Daten importieren eine Web-Abfrage mit dem Makro-Rekorder aufzeichnen und das als Basis nehmen.
Schöne Grüße,
Michael
Anzeige

74 Forumthreads zu ähnlichen Themen

Anzeige
Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige