Community of VE/MapPoint Users and Developers
This is a discussion on Trying to integrate Excel data into MapPoint within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I'm not sure if I can help with the bigger picture or not, but we have a product (RouteWriter) ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Re: Trying to integrate Excel data into MapPoint
I'm not sure if I can help with the bigger picture or not, but we have a product (RouteWriter) which helps with the pushpins <-> MapPoint routes side of things, rather than the Excel Import side of things. RouteWriter writes the pushpins to Excel in route order - ie. you've created your route, and you just want the order of the pins (and the other pin data). RouteWriter includes RouteReader which can create a route from existing pushpins, inserting the pins in a pre-defined order. The order is set using a data field (eg. a sequence number). Note that manually importing pins (as above) does not allow you to add custom data fields - you have to use one of MapPoint's wizards; but this probably academic because if you're adding the pins programmatically, you can also insert them in any order you feel like. RouteWriter: Export Routes from Microsoft MapPoint Richard
__________________ Winwaed Software Technology LLC http://www.winwaed.com See http://www.mapping-tools.com for MapPoint Tools Pre-Order MapPoint 2009 today: http://www.mapping-tools.com/mappoint2009 |
| |||
| Re: Trying to integrate Excel data into MapPoint
Hi co, I believe Richard was responding to your initial post: "They enter the data manually into Excel, then, manually enter much of the same data into MapPoint to calculate mileage and delivery times. After that, they enter the resultant MapPoint data into Excel again. (don't get me started on their OTHER inefficiencies)" Note that developers charge double that cost PER HOUR, eh. ![]() Mike Mattys |
| ||||
| Re: Trying to integrate Excel data into MapPoint
Yes I was looking at your original post. Often it is instructive to find out what a user is really trying to do - often there is a simpler approach. Richard
__________________ Winwaed Software Technology LLC http://www.winwaed.com See http://www.mapping-tools.com for MapPoint Tools Pre-Order MapPoint 2009 today: http://www.mapping-tools.com/mappoint2009 |
| |||
| Re: Trying to integrate Excel data into MapPoint UPDATE: OK, I've gotten this far. I'm able to get it to calculate the total route mileage based on each individual point on the route then I'm using Excel to calculate the individual segment mileage. From there, Excel can calculate the number of hours (rounded up) for that segment. Then, inserting a start time SHOULD give me my scheduling information. What I'm missing is some process that looks for a null value in the excel spreadsheet zip code column and STOPS the process there. Please see my totally inept attempt at showing what I mean in the code below. Note that I've rem'd those lines out. But it should tell you essentially what I want it to do. Any suggestions on how to phrase that so my computer knows what I'm talking about? I know next to nothing about vb scripting so I'm hoping someone might know. Here's what I want it to do... sort of: If Worksheets("Sheet1").Cells(4, 1) = "" Then End Sub Any help would be appreciated. Code: Private Sub CommandButton1_Click()
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(3, 1)
objRoute.Waypoints.Add objMap.FindResults(szZip1).Item(1)
objRoute.Waypoints.Add objMap.FindResults(szZip2).Item(1)
objRoute.Calculate
Worksheets("Sheet1").Cells(3, 3) = objRoute.Distance
'If Worksheets("Sheet1").Cells(4, 1) = "" Then End Sub
szZip3 = Worksheets("Sheet1").Cells(4, 1)
objRoute.Waypoints.Add objMap.FindResults(szZip3).Item(1)
objRoute.Calculate
Worksheets("Sheet1").Cells(4, 3) = objRoute.Distance
'If Worksheets("Sheet1").Cells(5, 1) = "" Then End Sub
szZip4 = Worksheets("Sheet1").Cells(5, 1)
objRoute.Waypoints.Add objMap.FindResults(szZip4).Item(1)
objRoute.Calculate
Worksheets("Sheet1").Cells(5, 3) = objRoute.Distance
'If Worksheets("Sheet1").Cells(6, 1) = "" Then End Sub
szZip5 = Worksheets("Sheet1").Cells(6, 1)
objRoute.Waypoints.Add objMap.FindResults(szZip5).Item(1)
objRoute.Calculate
Worksheets("Sheet1").Cells(6, 3) = objRoute.Distance
'If Worksheets("Sheet1").Cells(7, 1) = "" Then End Sub
szZip6 = Worksheets("Sheet1").Cells(7, 1)
objRoute.Waypoints.Add objMap.FindResults(szZip6).Item(1)
objRoute.Calculate
Worksheets("Sheet1").Cells(7, 3) = objRoute.Distance
'If Worksheets("Sheet1").Cells(8, 1) = "" Then End Sub
szZip7 = Worksheets("Sheet1").Cells(8, 1)
objRoute.Waypoints.Add objMap.FindResults(szZip7).Item(1)
objRoute.Calculate
Worksheets("Sheet1").Cells(8, 3) = objRoute.Distance
'If Worksheets("Sheet1").Cells(9, 1) = "" Then End Sub
szZip8 = Worksheets("Sheet1").Cells(9, 1)
objRoute.Waypoints.Add objMap.FindResults(szZip8).Item(1)
objRoute.Calculate
Worksheets("Sheet1").Cells(9, 3) = objRoute.Distance
'If Worksheets("Sheet1").Cells(10, 1) = "" Then End Sub
szZip9 = Worksheets("Sheet1").Cells(10, 1)
objRoute.Waypoints.Add objMap.FindResults(szZip9).Item(1)
objRoute.Calculate
Worksheets("Sheet1").Cells(10, 3) = objRoute.Distance
'If Worksheets("Sheet1").Cells(11, 1) = "" Then End Sub
szZip10 = Worksheets("Sheet1").Cells(11, 1)
objRoute.Waypoints.Add objMap.FindResults(szZip10).Item(1)
objRoute.Calculate
Worksheets("Sheet1").Cells(11, 3) = objRoute.Distance
'If Worksheets("Sheet1").Cells(12, 1) = "" Then End Sub
szZip11 = Worksheets("Sheet1").Cells(12, 1)
objRoute.Waypoints.Add objMap.FindResults(szZip11).Item(1)
objRoute.Calculate
Worksheets("Sheet1").Cells(12, 3) = objRoute.Distance
'If Worksheets("Sheet1").Cells(13, 1) = "" Then End Sub
szZip12 = Worksheets("Sheet1").Cells(13, 1)
objRoute.Waypoints.Add objMap.FindResults(szZip12).Item(1)
objRoute.Calculate
Worksheets("Sheet1").Cells(13, 3) = objRoute.Distance
'If Worksheets("Sheet1").Cells(14, 1) = "" Then End Sub
szZip13 = Worksheets("Sheet1").Cells(14, 1)
objRoute.Waypoints.Add objMap.FindResults(szZip13).Item(1)
objRoute.Calculate
Worksheets("Sheet1").Cells(14, 3) = objRoute.Distance
'If Worksheets("Sheet1").Cells(15, 1) = "" Then End Sub
szZip14 = Worksheets("Sheet1").Cells(15, 1)
objRoute.Waypoints.Add objMap.FindResults(szZip14).Item(1)
objRoute.Calculate
Worksheets("Sheet1").Cells(15, 3) = objRoute.Distance
'If Worksheets("Sheet1").Cells(16, 1) = "" Then End Sub
szZip15 = Worksheets("Sheet1").Cells(16, 1)
objRoute.Waypoints.Add objMap.FindResults(szZip15).Item(1)
objRoute.Calculate
Worksheets("Sheet1").Cells(16, 3) = objRoute.Distance
'If Worksheets("Sheet1").Cells(17, 1) = "" Then End Sub
szZip16 = Worksheets("Sheet1").Cells(17, 1)
objRoute.Waypoints.Add objMap.FindResults(szZip16).Item(1)
objRoute.Calculate
Worksheets("Sheet1").Cells(17, 3) = objRoute.Distance
'If Worksheets("Sheet1").Cells(18, 1) = "" Then End Sub
szZip17 = Worksheets("Sheet1").Cells(18, 1)
objRoute.Waypoints.Add objMap.FindResults(szZip17).Item(1)
objRoute.Calculate
Worksheets("Sheet1").Cells(18, 3) = objRoute.Distance
End Sub - co Last edited by checkedout; 05-05-2008 at 05:57 PM. |
| |||
| Re: Trying to integrate Excel data into MapPoint VICTORY! Using a loop, it works! Yay! Thanks to all who helped out. Posting the code here for your edification: Code: Private Sub CommandButton1_Click()
Dim Row As Integer
Set oApp = CreateObject("MapPoint.Application.NA.13")
oApp.Visible = True
Set objMap = oApp.NewMap
Set objRoute = objMap.ActiveRoute
szZip1 = Worksheets("Sheet1").Cells(2, 1)
objRoute.Waypoints.Add objMap.FindResults(szZip1).Item(1)
Row = 2
While Worksheets("Sheet1").Cells(Row, 1) <> ""
szZip = Worksheets("Sheet1").Cells(Row, 1)
objRoute.Waypoints.Add objMap.FindResults(szZip).Item(1)
objRoute.Calculate
Worksheets("Sheet1").Cells(Row, 3) = objRoute.Distance
Row = Row + 1
Wend
End Sub |
![]() |
| ||||
| Posted By | For | Type | Date | |
| MAPPOINT DOWNLOADS: License Agreement - MP2K Magazine | This thread | Refback | 04-21-2008 06:33 PM | |
| MapPoint Help - MP2K Magazine | This thread | Refback | 04-18-2008 03:49 AM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problems exporting MapPoint data to Excel in embedded map | o0beaner | MapPoint 2006/2009 Discussion | 4 | 03-12-2007 02:14 PM |
| How do I Integrate MapPoint with MSAccess | newlifcc | MapPoint 2006/2009 Discussion | 1 | 09-21-2005 12:22 PM |
| Linking Data within an Excel Workbook to Mappoint | XLR Excel | MapPoint 2006/2009 Discussion | 0 | 07-06-2005 01:23 PM |
| Error on import data from Excel to mapPoint | Anonymous | MapPoint 2006/2009 Discussion | 5 | 01-27-2005 03:06 PM |
| importing data from excel to mappoint | Layne | MapPoint 2006/2009 Discussion | 0 | 05-09-2003 12:40 PM |
Catered Chalet Ski Holidays
Looking for catered chalet ski holidays? Your search is over! Here at Holiday Hypermarket you can choose your style of accommodation with ease.
Flights to Spain
Find and book flights to Spain. Travel Counsellors can help with travel to Spain including flights and accommodation.
Cape Town Cheap Flights
Thinking about visiting Cape Town. Cheap flights are hard to find unless you visit dealchecker.co.uk. We'll shop around so you don't have to.
Holidays to Cancun
The Holiday Place has special offers on holidays to Cancun during the month of September. Book a late summer holiday with us!
Morocco
Gain insight on your holiday destination with the ULookUBook travel guides. Find out about Morocco and its customs online. Make an informed decision when you make a booking.
Price comparison sites
Travel.co.uk is the one you are looking for when checking out price comparison sites.
Cheap Lanzarote Holidays
The Canary Islands beckons you to come! View information on cheap Lanzarote holidays at On The Beach!