Google Maps Distance Matrix API Excel 2026 — Your VBA Broke. Here Is the Excel Fix
Updated September 2026 | By Excel Distance Calculators
If your Google Maps Distance Matrix VBA in Excel still hits the old endpoint in 2026, a brand-new Google Cloud project will refuse the call. Google moved Distance Matrix API and Directions API to Legacy on March 1, 2025. Existing projects keep the old service. New projects do not get it.
This is the breakage post. Never run an A-to-B pair in a sheet? Start with How to Calculate Driving Distance Between Two Addresses in Excel. If the workbook used to work and a new key killed it, stay here.
What broke on 1 Mar 2025
Google's Legacy list is the source. On March 1, 2025 they marked Distance Matrix API and Directions API as Legacy, with Routes API as the replacement. Their rule: Legacy services are not available in new Cloud projects. They remain fully supported on projects that already had them. There is no turn-down date. Google says they will give at least 12 months' notice before they decommission anything.
That is why a macro that ran for three years dies the week IT issues a "clean" project and a new key. The workbook is the same. The key is valid. The service your GET still names is not something a new project can enable.
- Old project, old key, still OK — Distance Matrix (Legacy) keeps answering if it was already enabled.
- New project, new key, dead GET — you cannot turn Legacy Distance Matrix on anymore.
- Power Query or VBA, same break — the host does not matter. The endpoint does.
How a Logistics Analyst Hits This: A fleet ops coordinator had VBA pulling driving miles for weekly IFTA and payroll. IT rotated keys after a leak and created a new Cloud project. Same .xlsm, same To/From columns, new key. Every row came back REQUEST_DENIED. Distance Matrix was not in the API library to enable. The sheet was never the problem. The new project cannot run Legacy Distance Matrix. They needed a Routes-era file.
Routes API vs the old Distance Matrix call
The old Distance Matrix call is an HTTP GET. Origins and destinations sit in the URL. JSON or XML comes back. That is what most Excel VBA and Power Query from 2018–2024 still does.
Routes API is a different service. You enable one API — Routes — then send an HTTPS POST with a JSON body and a field mask. Distances come back in meters. Parameter names changed. We are not going to paste a Routes rewrite here. That is a week of VBA, headers, and parse errors. A free city widget does not fix a 500-row workbook. The maintained file already speaks Routes. You paste addresses.
| Piece | Old Distance Matrix VBA | Excel Distance Calculator |
|---|---|---|
| Google service | Distance Matrix API (Legacy) — GET | Routes API (plus Geocoding) |
| New Cloud project | Cannot enable Legacy Distance Matrix | Enable Routes + Geocoding, paste the key |
| What you maintain | Endpoints, headers, meters vs miles | To / From columns. We maintain the file |
| 500 address pairs | Your rewrite, your weekend | Paste, click Calculate |
Paste To/From, Calculate
Open the Excel Driving Distance Calculator. It is a .xlsm, not an install. Enable macros. Paste real To and From addresses — payroll, IFTA, a 500-row dispatch sheet. Click Calculate. Google Maps driving distance and time write back into the sheet. You do not touch Routes JSON. The click path for the key is Set Up Google Maps API Key. Every purchase includes a free Zoom to do that screen-share with you.
$97 single user / $187 multi-user, one-time. New Cloud projects cannot enable Legacy Distance Matrix. You are buying a maintained Routes-era file so the 500-row workbook runs again.
Real-World Example: A regional dispatcher had 500 store-to-job pairs in one sheet. The old VBA died the day they moved to a new Google project. They pasted the two columns into the distance file, put the new key in the API key cell, and ran Calculate. The first 10 rows proved the APIs. The rest of the list followed.
Need latitude and longitude columns as well as miles? That is a side file, not a second distance engine: Excel GeoCoder.
REQUEST_DENIED means the wrong APIs
Google's Distance Matrix status list is blunt: REQUEST_DENIED means the service denied use of Distance Matrix by your application. In Excel that is not a formula bug. The project is not allowed to run the API your workbook is calling.
On a 2026 project, enabling Maps JavaScript — or hunting for Distance Matrix in the library — does not save a Legacy GET. Enable the services the current file actually calls:
- Routes API — driving distance and travel time
- Geocoding API — turns the text in To / From into a place Google can route
Confirm both show under Enabled APIs. If the key is restricted, add those two to the restriction list. A key still locked to Distance Matrix (Legacy) will deny Routes the same way. Paste the key into the spreadsheet's API key cell and run 8–10 real rows. If those fill, the rest of the list will too.
Billing is a different problem. You still need a billed Cloud project or Google will not issue a key. For the click-by-click Console path, use the setup post. Or skip Console archaeology: call (801) 243-8350 and we do it on Zoom.
Frequently Asked Questions
Why did my Google Maps Distance Matrix API Excel 2026 VBA fail on a new Cloud project?
Because the new project cannot enable Legacy Distance Matrix. Google marked that API Legacy on March 1, 2025. Enable Routes + Geocoding and use a Routes-era workbook, or keep the old project if it already had Distance Matrix on.
Can I just turn Distance Matrix back on?
On an existing project that already had it, yes — leave it. On a new project, no. Google's Legacy page says those services are not available in new Cloud projects. Enabling a pile of other Maps APIs does not resurrect the old GET.
Do I need to rewrite the VBA myself?
Only if you want to own Routes POST bodies, field masks, and meter-to-mile conversion forever. That is what the Excel Driving Distance Calculator already does. Paste To/From, click Calculate.
Ready to Stop Doing It the Hard Way?
Get the Excel Driving Distance Calculator — $97 single user / $187 multi-user, one-time. Maintained Routes-era file. Paste To and From, click Calculate, get Google Maps miles and time in the sheet. Free Zoom to set the API key. Questions? Call (801) 243-8350.
Excel Distance Calculators builds Excel-based tools that connect directly to Google Maps for driving distances, geocoding, route optimization, and more. Used by logistics companies, trucking fleets, healthcare providers, field service teams, and thousands of businesses worldwide. No coding required — just paste your data and click.