Community of MapPoint and Bing Maps Users and Developers
This is a discussion on Using MapPoint function from EXCEL VBA within the MapPoint Desktop Discussion forums, part of the Map Forums category; I have this code in an excel file; the idea being to read two postcodes from cells A1 and B1, ...
| |||||||
| Today's Posts | Twitter Feed | Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Using MapPoint function from EXCEL VBA I think the code is ok, but when I run it it says "User-Defined type not defined" and highlights the second line. Do I need to set up a specific tools>reference in Excel VBA first? Pretty please?! ______________ Sub ShowDistance() Dim objApp As New MapPoint.Application Dim objMap As MapPoint.Map Dim objLocOne As MapPoint.Location Dim objLocTwo As MapPoint.Location Dim LocOne, LocTwo As String Dim Distance As Long Set objMap = objApp.ActiveMap LocOne = Cells(1, 1) LocTwo = Cells(1, 2) Set objLocOne = objMap.FindResults(LocOne).Item(1) Set objLocTwo = objMap.FindResults(LocTwo).Item(1) 'Show the distance Distance = objMap.Distance(objLocOne, objLocTwo) Cells(1, 3) = Distance End Sub |
| ||||
|
Hi Jonboy, I wrote a tutorial related to this earlier this afternoon which I plan to publish tomorrow -- http://www.mp2kmag.com/update/mappoi...er/2005-04-26/ I think the answer to your question is actually in the Part I of the tutorials. Eric
__________________ |
| |||
| Re: Using MapPoint function from EXCEL VBA
I've just tried the code provided in the tutorial part III, but vba keeps on returning the same error message (Run-time error '429': ActiveX component can't create object ...) I'm running Excel 2003 and MapPoint 2004. Is there something I'm missing here? Thanks for your help! |
| |||
| Re: Using MapPoint function from EXCEL VBA
Hi Eric, I have tried all the above steps, and also gone through the first tutorial in detail. I still receive the error: (Run-time error '429': ActiveX component can't create object ...) Not sure what is going wrong. I am using Office 2007 on Vista home, and using the trial version of MapPoint. Thanks. |
| |||
| Re: Using MapPoint function from EXCEL VBA
Eric, I figured, it was about EU versus NA, and 16 versus 11. Thanks. I now need to fetch distances for multiple origin-destination pairs. Where can I find some sample code for the same? Do I need to worry about closing and opening MapPoint for each 'fetch'? Or would the application handle 4-5000 distances without crashing? Thanks for your help. |
![]() |
| Tags |
| excel, function, mappoint, vba |
| ||||
| Posted By | For | Type | Date | |
| Gmane -- Mail To News And Back Again | This thread | Refback | 06-19-2009 03:32 PM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need Help using the SUM function for County | Anonymous | MapPoint Desktop Discussion | 1 | 04-08-2005 10:48 PM |
| Correlation between Mappoint FIND function and MPC??? | GM | MapPoint Desktop Discussion | 0 | 11-02-2004 02:40 PM |
| Problems with ShowFindDialog function in C++ | Anonymous | MapPoint Desktop Discussion | 1 | 10-06-2003 04:13 AM |
| Fix DistanceTo function | PC | Wish List | 1 | 03-21-2003 05:35 AM |
| Mappoint 2002 application provides the function th.... | Anonymous | MapPoint Desktop Discussion | 1 | 12-20-2001 09:48 AM |