This macro uses google map to get the driving distance and time between
2 zipcodes. It should get you started. Let me know if you need more
help. I've done this with almost all map utilities including people in
England which uses Postal codes. I also can extract the GPS Longitude
and Latitude from the maps.
Sub FindDistance()
Const READYSTATE_COMPLETE = 4
URL = "http://maps.google.com/maps?hl=en&tab=wl"
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True
ie.Navigate URL
Do While ie.readystate < 4 Or ie.busy = True
DoEvents
Loop
Set StartLocation = ie.document.getelementbyid("d_d")
StartLocation.innertext = "07508"
Set EndLocation = ie.document.getelementbyid("d_daddr")
EndLocation.innertext = "10001"
Set submit = ie.document.getelementbyid("d_sub")
'submit.Select
submit.form.submit
Do While ie.readystate < 4 Or ie.busy = True
DoEvents
Loop
Call Dump(ie.document)
Set distance = ie.document.getelementbyid("dditd")
MsgBox (distance.innertext)
Set ie = Nothing
End Sub
--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread:
http://www.thecodecage.com/forumz/sh...d.php?t=185400
Excel Live Chat