Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 5 of 5

Display Optimized Route - VBA and Excel

This is a discussion on Display Optimized Route - VBA and Excel within the MapPoint Desktop Discussion forums, part of the Map Forums category; Well I have figured out how to get the waypoints into MapPoint 2006, now how do I get the optimized ...

  1. #1
    mikebres is offline Junior Member White Belt
    Join Date
    May 2008
    Posts
    5

    Display Optimized Route - VBA and Excel

    Well I have figured out how to get the waypoints into MapPoint 2006, now how do I get the optimized result? :/

    I have tried the For Each...Next loop with both the Waypoints collection and the Directions collection. I haven't been able get the result I need. I'm looking for a list of the optimized route with the elapsed time and the elapsed distance next to each waypoint.

    code segment:
    For Each D In .Directions
    idx = D.Index
    ActiveCell.Offset(1, 0).Activate
    If D.Type = 9 Then
    objRoute.Directions.item(idx).Waypoint.Name
    End If
    Next

    When shorthand notation didn't work I also tried it with the full reference. Neither one have worked. So obviously I'm missing something.

    I keep getting "Object dosen't support this item or method" error.

    Does anybody have any suggestions.

    TIA
    Mike

  2. #2
    alexramo is offline Member Green Belt
    Join Date
    Sep 2008
    Posts
    63

    Re: Display Optimized Route - VBA and Excel

    how are you optimizing the route, with the ruote optimization function included in MapPoint, or some other way?

    Are you trying to optimize it with your for next loop, and just want help with the coding, or are you looking for that functionality before you export to excel?

  3. #3
    mikebres is offline Junior Member White Belt
    Join Date
    May 2008
    Posts
    5

    Re: Display Optimized Route - VBA and Excel

    Quote Originally Posted by alexramo View Post
    how are you optimizing the route, with the ruote optimization function included in MapPoint, or some other way?

    Are you trying to optimize it with your for next loop, and just want help with the coding, or are you looking for that functionality before you export to excel?
    Thanks for the help. I know how to optimize the route, that part was easy.
    .Waypoints.Optimize
    .Calculate

    Now that I have the route how do I list the result back into Excel? Here is the workflow I'm looking for. I list the addresses I want for the route. With the start and end point being the same place for a round trip. Then I load them in as waypoints, optimize them, do the calculation. Now I want to list out the optimized route into Excel along with the cumulative distance and time. I only want to show the waypoints, not all of the driving directions.

    I should explain it's not the Excel part, I know how to put values into cells. The part I am having trouble with is the MapPoint part. How do I get the information from MapPoint about each of the waypoints in the new optimized order, with distance and time?

    Thanks
    Mike

  4. #4
    alexramo is offline Member Green Belt
    Join Date
    Sep 2008
    Posts
    63

    Re: Display Optimized Route - VBA and Excel

    check out this website,
    RouteWriter: Export Microsoft MapPoint Route WayPoints to Excel

    Mappoint doesn't have the functionality to export your points in the order you optimized them( i have no idea why, seems to me thats one of the first things they should have thought about!)

    this tool will export them in your optimized route.

    Hope that helps.

    There's also another programmer on these mapPoint forums, his name is Mike Matty's he helped me in the past with a problem, I wanted to draw my route and export my pushpins in that particualr order, and aslo have the distance between them, and total distance. it was pretty cool and useful.

    You can contact him at
    Mattys Consulting - Custom Programming

    good luck.

  5. #5
    mikebres is offline Junior Member White Belt
    Join Date
    May 2008
    Posts
    5

    Re: Display Optimized Route - VBA and Excel

    Quote Originally Posted by alexramo View Post
    check out this website,
    RouteWriter: Export Microsoft MapPoint Route WayPoints to Excel

    this tool will export them in your optimized route.

    Hope that helps.

    You can contact him at
    Mattys Consulting - Custom Programming

    good luck.
    Ahh, money. I am a small cog in a large organization, and I don't the authority to spend money for the corp. I can use what we already have, such as Excel and MapPoint, to create the tools I need, but I am not allowed to buy or even install new software. Our computer network is very controlled.

    But, thank you anyway.
    Mike

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Outputting Optimized Route Order to a Table
    By gcwebbyuk in forum Development
    Replies: 2
    Last Post: 11-06-2008, 07:47 AM
  2. Export Optimized Route
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 03-04-2005, 06:34 AM
  3. Display Existing Map in Excel
    By mjlacore in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 04-19-2004, 10:01 AM
  4. Export in Optimized Order to Excel
    By erkorb in forum Wish List
    Replies: 1
    Last Post: 12-06-2003, 12:24 PM
  5. We created a route of 700+ stops and optimized it.....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 09-07-2001, 05:27 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79