tRequestHeader "User-Agent", "Mozilla/4.0 (compatible MSIE 6.0 Windows NT 5.0)" Url = firstVal & start & secondVal & dest & lastVal Set objHTTP = CreateObject("MSXML2.ServerXMLHTTP") LastVal = "&travelMode=driving&o=xml&key=&distanceUnit=mi" The code pieces in use are: Public Function GetDistance(start As String, dest As String)ĭim firstVal As String, secondVal As String, lastVal As String This is an amalgamation of multiple different processes found through Google searches. I am not a coder, but I can functionally modify found code to my purposes. The employee population is approximately 2300, and it takes almost an hour to execute. The process is working, but it is excruciatingly slow. The process follows this general flow:ġ) Convert the employee's address to Lat-Long values using the GetLatLong functionĢ) Convert the employee's work address to Lat-Long values using the GetLatLong functionģ) Calculate the distance between these two points using the GetDistance functionĤ) Calculate the drive time between these two points using the GetTime function I am writing VBA in Excel to calculate the distance between an employee's home address and work address using Bing Maps API calls.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |