filmov
tv
Auto Populate Latitude and Longitude Function in Excel (NEW VERSION)
Показать описание
How to write a custom function that converts a physical address to latitude and longitude coordinates in Excel using Google's Geocoding API.
00:00 - Introduction
00:16 - Overview of Custom Function in Excel
00:47 - Accessing Developer Ribbon in Excel
01:09 - Opening Visual Basic for Applications
01:31 - Finding and Copying the Code
02:21 - Pasting the Code in Visual Basic
02:51 - Enabling Microsoft XML Version 3.0 Reference
03:18 - Requirement of Google API Key (2018 Update)
04:11 - How to Get Google Geocoding API Key
05:41 - Testing the Custom Function in Excel
06:05 - Conclusion and Final Thoughts
------------------------------------
My best advice for those struggling to get this to work is to:
A) follow the instructions to the T. I know that's easier said than done, but if you're not saving the file as a Macro-Enabled file, not turning on Microsoft XML 3.0, entering the API key in the wrong place or inadvertently deleting something from the VBA code, or not entering the address correctly, etc, than you will get an error.
B) Make sure you're running the most recent version of Excel. This code may work with older version of Excel, but I have not tested it on versions earlier than 2016.
C) Make sure you have billing details on file with Google in order for your API key to work.
While Google gives you a certain number of API requests for free (~2500/day last I checked), Google requires users have a credit card on file to avoid abuse of the API.
Also here's a quick tip. If you use the GETCOORDINATES() function, the VBA code has a few built-in custom error messages that will help you troubleshoot what you're doing wrong. For instance, if you haven't setup your API key correctly, the cell will output: "Invalid API Key".
Note that in the video, I'm using Excel 365 on Windows 10, and I have provided billing details to Google in order to secure the API.
00:00 - Introduction
00:16 - Overview of Custom Function in Excel
00:47 - Accessing Developer Ribbon in Excel
01:09 - Opening Visual Basic for Applications
01:31 - Finding and Copying the Code
02:21 - Pasting the Code in Visual Basic
02:51 - Enabling Microsoft XML Version 3.0 Reference
03:18 - Requirement of Google API Key (2018 Update)
04:11 - How to Get Google Geocoding API Key
05:41 - Testing the Custom Function in Excel
06:05 - Conclusion and Final Thoughts
------------------------------------
My best advice for those struggling to get this to work is to:
A) follow the instructions to the T. I know that's easier said than done, but if you're not saving the file as a Macro-Enabled file, not turning on Microsoft XML 3.0, entering the API key in the wrong place or inadvertently deleting something from the VBA code, or not entering the address correctly, etc, than you will get an error.
B) Make sure you're running the most recent version of Excel. This code may work with older version of Excel, but I have not tested it on versions earlier than 2016.
C) Make sure you have billing details on file with Google in order for your API key to work.
While Google gives you a certain number of API requests for free (~2500/day last I checked), Google requires users have a credit card on file to avoid abuse of the API.
Also here's a quick tip. If you use the GETCOORDINATES() function, the VBA code has a few built-in custom error messages that will help you troubleshoot what you're doing wrong. For instance, if you haven't setup your API key correctly, the cell will output: "Invalid API Key".
Note that in the video, I'm using Excel 365 on Windows 10, and I have provided billing details to Google in order to secure the API.
Комментарии