Community of VE/MapPoint Users and Developers
This is a discussion on How to calculate distance between 2 location with vba within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi , i have map point 2004 and access, and i want to take data in my, db 2 locations ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| How to calculate distance between 2 location with vba how can i automate this ??? Thanks in advance |
| |||
|
Here is the code to do that (distance between 2 Postal Code (Zip) ) i finaly find it Code: Sub GetKm()
Set oApp = New MapPoint.Application
Set oMap = oApp.NewMap
Set oLoc(1) = oMap.FindAddressResults("", "mons", , , "7000", "Belgium")
Set oLoc(2) = oMap.FindAddressResults("", "namur", , , "5000", "Belgium")
Set Loca(1) = oLoc(1).Item(1)
Set Loca(2) = oLoc(2).Item(1)
If Not oLoc(1) Is Nothing Then 'Check to see if the first address was found.
If Not oLoc(2) Is Nothing Then 'Check to see if the second address was found
Debug.Print oMap.Distance(Loca(1), Loca(2))
End If
End If
Set oMap = Nothing
Set oApp = Nothing
End Sub
|
![]() |
| Tags |
| calculate, distance, location, vba |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to calculate distance between location and route ? | tontaegu | MapPoint 2006/2009 Discussion | 1 | 10-19-2005 02:14 PM |
| Calculate new location from lat/lon + bearing + distance | Anonymous | MapPoint 2006/2009 Discussion | 1 | 05-05-2004 08:59 AM |
| How to calculate distance using Mappoint and VB | digish | MapPoint 2006/2009 Discussion | 0 | 02-27-2004 04:40 PM |
| So how do i get it to calculate teh distance betwe.... | Anonymous | MapPoint 2006/2009 Discussion | 1 | 12-19-2001 08:42 AM |
| I would like to calculate the distance from multip.... | Anonymous | MapPoint 2006/2009 Discussion | 1 | 10-31-2001 04:39 AM |