Excel and the Google Maps API

BombCenter

New Member
Joined
Aug 31, 2011
Messages
19
So I was approached by Accounting with an interesting project today. I work IT for a large-ish construction company, and one of the hassles of mileage reimbursement is getting the driving distances for all the field technicians from their respective homes to the site they're currently deployed to. Accounting, being familiar with Excel, wanted to know if I could author a spreadsheet that would accept a list of addresses (e.g., Column A) and a list of destinations (e.g., Column C) and return the driving distances between them (e.g., Column E). As an added feature (but not required), they'd like driving routes color-coded and super-imposed on a dynamically generated map (which the API can supply) bound to a div on the spreadsheet.

I've briefly looked at the Google Maps DistanceMatrix API (https://developers.google.com/maps/documentation/distancematrix/), and generating the query and parsing the returned JSON/XML (example result: http://maps.googleapis.com/maps/api/distancematrix/json?origins=Vancouver+BC|Seattle&destinations=San+Francisco|Victoria+BC&mode=bicycling&language=fr-
FR&sensor=false
) is simple enough, but where I'm stumped is: How do I get Excel to fetch it into a string or whatever that I could then parse values out of? Is this possible?
 
Last edited:

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
BombCenter,

See if something below will assist you:

Try this udf it will help you in finding the time and distance between two cities using Google Map
Ashish Koul
Excel VBA Codes & Macros
http://www.accessvbamacros.com/


Custom Function to get Drive Time between two points
Custom Function to get Drive Time between two points

convert some latitude and longitude coordinates from "Degrees, Decimal Minutes" format to "Decimal Degrees" format
How to convert degrees/minutes/seconds angles to or from decimal angles in Excel 2000
How to convert degrees/minutes/seconds angles to or from decimal angles in Excel 2000

How to get lat/long coordintates with VBA Excel
How to get lat/long coordintates with VBA Excel

Resources for determining your latitude and longitude
How to find your latitude and longitude

Finding the location of a non-US city
Here are some sites that have the locations of major cities in the world.
Latitude-Longitude of World Cities (www.realestate3d.com)
Latitude and Longitude of World Cities (London, L.A., Paris, Singapore) | Infoplease.com
 
Upvote 0

Forum statistics

Threads
1,215,050
Messages
6,122,868
Members
449,097
Latest member
dbomb1414

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top