Community of VE/MapPoint Users and Developers
This is a discussion on Using MapPoint function from EXCEL VBA within the MapPoint 2006/2009 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, ...
| |||||||
| 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! |
![]() |
| Tags |
| excel, function, mappoint, vba |
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 2006/2009 Discussion | 1 | 04-08-2005 11:48 PM |
| Correlation between Mappoint FIND function and MPC??? | GM | MapPoint 2006/2009 Discussion | 0 | 11-02-2004 03:40 PM |
| Problems with ShowFindDialog function in C++ | Anonymous | MapPoint 2006/2009 Discussion | 1 | 10-06-2003 05:13 AM |
| Fix DistanceTo function | PC | Wish List | 1 | 03-21-2003 06:35 AM |
| Mappoint 2002 application provides the function th.... | Anonymous | MapPoint 2006/2009 Discussion | 1 | 12-20-2001 10:48 AM |