If you use the classic Distance Matrix Calculator Excel template, you can move to the add-in in a few minutes. Your Google Maps API key and your license key stay the same. The only new step is enabling one more Google API.
The video uses the Distance Calculator as the example. For the Distance Matrix Calculator, search for Distance Matrix Calculator instead; every other step is the same.
1. Enable the Maps JavaScript API #
- Sign in to the Google Cloud Console.
- Click the project picker in the top left corner and select the project you created for the Excel template. Its name then shows at the top of the page.
- Search for Maps JavaScript API, open it and click Enable. This direct link opens the same page.
To check, open Enabled APIs & services. The list should include Maps JavaScript API and Routes API. The Routes API was already on for the template, so leave it as it is.
2. Copy your Google Maps API key #
Use the same key as in the template. Copy it from the Settings sheet of your template, or find it in the Cloud Console under Keys & Credentials: click Show key and copy it.
Did you restrict the key? The template calls Google from your computer, but the add-in runs inside Excel like a website. If the key has API restrictions, add Maps JavaScript API to the allowed list. If it is restricted to IP addresses, create a second key for the add-in with Websites restrictions and keep your current key in the template. Changing the existing key to Websites would stop the template from working. The Google Maps API troubleshooting guide shows the exact settings.
3. Install the add-in #
The add-in needs Microsoft 365 or Office 2021 and later on Windows or Mac, or Excel on the web. Which Excel version do I need? has the details.
- In Excel, go to Home > Add-ins and click More Add-ins.
- Search for Distance Matrix Calculator, click Add and then Continue.
4. Save your keys #
- After a few seconds the task pane opens. Click Open key settings.
- Paste your Google Maps API key and click Save and test.
- Paste your license key and click Save and check.
Both keys now show Valid, and the add-in is ready in every workbook you open.
“Maximum number of devices” message #
The add-in counts as a new device, separate from the template, and one license covers up to 3 devices. If the license check says your key is already active on the maximum number of devices, remove a device you no longer use in your account and click Save and check again.
What is different? #
The add-in works right inside your own workbooks, runs on Windows, Mac and Excel on the web, and needs no macros. The full comparison lists the differences. If a key still does not validate, contact support.
