I have been using the following code to help me determine the distances between stores. It works great, but I want to be more accurate and I want to use Latitude and Longitude.
Can someone help me modify the code so I can bring in a latitude and longitude for each of the two locations and then have it tell me the distance between the two?
Function MPRouteDist(iMPType As Integer, ParamArray WPoints())
Dim objApp As New MapPoint.Application
Set objMap = objApp.ActiveMap
For Each wpoint In WPoints
.Waypoints.Item(1).SegmentPreferences = iMPType
MPRouteDist = Application.Round(CStr(.Distance), 5)
objMap.Saved = True
A little bonus help as well. Is there a way to take the same information and have Mappoint tell me the minutes it would take to drive between the two locations?
Any and all help is greatly appreciated! Thanks