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 2 of 2

route optimization - help need

This is a discussion on route optimization - help need within the MapPoint Desktop Discussion forums, part of the Map Forums category; I need Your help on: Can You add for me to my compilation: 1) if fields in column c,d,e are ...

  1. #1
    jakevo is offline Junior Member Yellow Belt
    Join Date
    Jan 2010
    Posts
    18

    Question route optimization - help need

    I need Your help on:
    Can You add for me to my compilation:
    1) if fields in column c,d,e are calculated than go tofirst line which is not calculated but filled in in colmns a + b

    2) if A10 & b10 is empty than go to a11&b11 and calculate

    3) use motorways - max
    national roads - max - 2

    4) fuel consumtion:
    city - 20
    other - 16
    cost per liter - 2,20

    5) stop for 30minutes after 3hrs driving

    6) do this all in all sheets of this file

    on following sheet

    Private Sub OBLICZ()
    Dim objApp As New MapPoint.Application
    Dim objMap As MapPoint.Map
    Dim objRoute As MapPoint.Route
    Dim objLoc1 As MapPoint.Location
    Dim objLoc2 As MapPoint.Location

    Set objApp = CreateObject("MapPoint.Application.EU.16")
    objApp.Visible = False

    Set objMap = objApp.NewMap
    Set objRoute = objMap.ActiveRoute
    Worksheets("Arkusz1").Cells(1, 3).Value = "ODLEGŁOŚĆ (kms)"
    Worksheets("Arkusz1").Cells(1, 4).Value = "Czas(mins)"
    Worksheets("Arkusz1").Cells(1, 5).Value = "Koszt(PLN)"
    NReadRow = 2

    Do While Worksheets("Arkusz1").Cells(NReadRow, 2) <> ""

    'Locate the 2 points
    Set objLoc1 = objMap.FindResults(Worksheets("Arkusz1").Cells(NRe adRow, 1)).Item(1)
    Set objLoc2 = objMap.FindResults(Worksheets("Arkusz1").Cells(NRe adRow, 2)).Item(1)

    'Calculate the route
    objRoute.Waypoints.Add objLoc1
    objRoute.Waypoints.Add objLoc2
    objRoute.Calculate

    'Drive Distance in kms
    Worksheets("Arkusz1").Cells(NReadRow, 3) = objRoute.Distance
    'Drive Time in minutes
    Worksheets("Arkusz1").Cells(NReadRow, 4) = objRoute.DrivingTime
    'Straight Line Distance in kms (as a check)
    Worksheets("Arkusz1").Cells(NReadRow, 5) = objRoute.Cost
    objRoute.Clear

    NReadRow = NReadRow + 1
    objMap.Saved = True

    Loop

    End Sub


    Many thanks

  2. #2
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: route optimization - help need

    Hi,

    I don't fully understand your question, but it seems Excell related. It this correct? If so I think you better repost this in some Excell forum where you will get possible a better answer related to your problem.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Route Optimization
    By sessler in forum Development
    Replies: 9
    Last Post: 01-19-2010, 05:11 AM
  2. Route optimization
    By Lanzo in forum Bing Maps and MapPoint Web Service
    Replies: 5
    Last Post: 09-22-2009, 03:17 AM
  3. Route Optimization in Bing Maps powered by OnTerra’s free Stop Optimization Service
    By Johannes Kebeck's Blog in forum Bing Maps Blogs & Tweets
    Replies: 0
    Last Post: 07-01-2009, 07:11 AM
  4. In using Optimization for a route, is there any wa....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 11-18-2008, 02:38 AM
  5. Route Optimization
    By Jeff Smith in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 03-23-2005, 02:06 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 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132