bringing Google Maps data into Excel in iOS

1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 5.00 out of 5)
Loading...
Go back to All Questions Login or Register
0
Bruce Batchelor 5 Rep.

We can use your code to ask Google Maps for distance and duration data into an Excel spreadsheet on a Windows machine – thanks. BUT the same xls won’t work on a Mac. Do you have a fix?

Here’s the offending line:
Set objHTTP = CreateObject(“MSXML2.ServerXMLHTTP”)

Here’s the code we were using in Excel for Windows:
Public Function GetDistance(start As String, dest As String)
Dim firstVal As String, secondVal As String, lastVal As String
firstVal = “http://maps.googleapis.com/maps/api/distancematrix/json?origins=”
secondVal = “&destinations=”
lastVal = “&mode=car&language=pl&sensor=false”
Set objHTTP = CreateObject(“MSXML2.ServerXMLHTTP”)
URL = firstVal & Replace(start, ” “, “+”) & secondVal & Replace(dest, ” “, “+”) & lastVal
objHTTP.Open “GET”, URL, False
objHTTP.setRequestHeader “User-Agent”, “Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)”
objHTTP.send (“”)
If InStr(objHTTP.responseText, “””distance”” : {“) = 0 Then GoTo ErrorHandl

thanks, cheers, Bruce

AnalystCave answered
0
AnalystCave 335 Rep.

Hi,

not so easy Bruce. Unfortunately, I don’t use Mac and can’t help you there. VBA in Mac is generally no a good idea due to the limitations. If this is a one-off exercise I would recommend using Windows to download the data from Google and then do the data crunching on the Mac.

Bruce Batchelor commented on answer
×

Login

Simply the best place to learn VBA!

Error: Please enter a valid email address

Error: Invalid email

Error: Please enter your first name

Error: Please enter your last name

Error: Please enter a username

Error: Please enter a password

Error: Please confirm your password

Error: Password and password confirmation do not match