Community of VE/MapPoint Users and Developers
This is a discussion on ArtS within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Driving Distance Between 2 Zip Codes. I'm trying to create a macro in Excel to import the driving distance between ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Re: ArtS
Check out this thread and example code, it should be enough to get you started. Also, see the example code at Working With Excel and MapPoint - MP2K Magazine Eric |
| |||
|
Eric, Thank you so much! I finally got it working & it's working great. I had to make some minor modifications. This is the exact code I used: Code:
Dim oApp As MapPoint.Application
Private Sub CalculateDrivingDistance()
Set oApp = CreateObject("MapPoint.Application.NA.13")
oApp.Visible = True
Set objMap = oApp.NewMap
Set objRoute = objMap.ActiveRoute
szZip1 = Worksheets("Sheet1").Cells(2, 1)
szZip2 = Worksheets("Sheet1").Cells(2, 2) 'Add route stops and calculate the route
objRoute.Waypoints.Add objMap.FindResults(szZip1).Item(1)
objRoute.Waypoints.Add objMap.FindResults(szZip2).Item(1)
objRoute.Calculate Worksheets("Sheet1").Cells(2, 3) = objRoute.Distance
End Sub
Now I'm trying to tweek it some more. How would I add in the driving time & how could I make MapPoint go to the back automatically so I only see the Excel spread sheet? Thanks Again! Sincerely, Art |
![]() |
| Tags |
| arts |
| ||||
| Posted By | For | Type | Date | |
| Microsoft MapPoint 2006 - MP2K Magazine | This thread | Refback | 04-17-2007 02:59 PM | |
| MapPoint Gets New General Manager - MapPoint News - MP2K Magazine | This thread | Refback | 04-14-2007 09:50 AM | |
| The Magazine for MapPoint - MP2K Magazine | This thread | Refback | 04-12-2007 05:56 PM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |