Hello everyone,
I have only recently started using MapPoint so my knowledge of this software is literally non-existant. My VBA knowldge, as you will notice, is also quite limited.
What I am trying to do is to simply enter data in Excel (country, city and post code) and then create a macro which will open MapPoint and enter the postcodes in RoutePlanner. From previous threads in this forum I found a VBA code which does exactly what i want but when I tried to use it, nothing is entered in RoutePlanner.
Can someone plz have a look at the code and let me know what i am doing wrong?Code:Sub Add_Address_To_Route_Planner() ' ' Add_Address_To_Route_Planner Macro Set App = CreateObject("MapPoint.Application") App.Visible = True Set objMap = App.NewMap Set objRoute = objMap.ActiveRoute Row = 2 While Cells(Row, 1) < "5" objRoute.Waypoints.Add objMap.FindAddressResults([Country], [City], [PostalCode]) Cells(Row, 1) = [Country] Cells(Row, 2) = [City] Cells(Row, 3) = [PostalCode] Row = Row + 1 Wend MsgBox ("Click ok to retun to excel") ' End Sub
Btw I am currently using Excel 2007 and MapPoint 2009.
Thank you very much




LinkBack URL
About LinkBacks






Reply With Quote

