Apparently not possible (Google seems to have a 'always change what works' policy):
Sub snb()
c01 = "4522EG + Nederland"
c02 = "3571NC + Nederland"
With New XMLHTTPRequest
.Open "Get", "http://maps.google.nl/maps?f=d&source=s_d&saddr=" & c01 & "&daddr=" & c02
.send
Do
DoEvents
Loop Until .readyState = 4
c03 = .responsetext
.abort
End With
If InStr(c03, "km</span>") <> 0 Then
c03 = Mid(c03, InStr(c03, "km</span>") - 6, 40)
If Val(c03) = 0 Then c03 = Mid(c03, 2)
If Val(c03) = 0 Then c03 = Mid(c03, 2)
c04 = Split(c03, "<")(0)
c03 = Split(Split(c03, ">")(2), "<")(0)
MsgBox "Distance: " & c04 & String(2, vbLf) & "Duration: " & c03
End If
End Sub
NB. you need a reference to Microsoft XML version 2.0
Bookmarks