MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




ArtS

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 ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack (3) Thread Tools Display Modes
  3 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 04-12-2007
Junior Member
White Belt
 
Join Date: Apr 2007
Posts: 6
Question ArtS

Driving Distance Between 2 Zip Codes.
I'm trying to create a macro in Excel to import the
driving distance between 2 zip codes from MapPoint 2006. Any suggestions?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 04-12-2007
Eric Frost's Avatar
Senior Member
Black Belt
 
Join Date: Jul 1992
Posts: 2,470
Blog Entries: 1
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 04-18-2007
Junior Member
White Belt
 
Join Date: Apr 2007
Posts: 6
Smile Re: ArtS

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 04-18-2007
Eric Frost's Avatar
Senior Member
Black Belt
 
Join Date: Jul 1992
Posts: 2,470
Blog Entries: 1
Re: ArtS

Just comment out this line or change it to false!

Code:
 
oApp.Visible = True
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
arts


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/arts-5829.html

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -5. The time now is 02:15 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54