I was asked for a downloadable file with the
G_LATLNG by Filipe who was having trouble getting the function working. Since I posted that, I’ve done a bit of further work to improve it. The workbook you can download caches results from
G_DISTANCE queries to reduce the amount of time spent polling Google. This also helps to avoid hitting the buffers in terms of how many queries they allow you – 2,500 per day, but they also seem to have soft limits over shorter time periods.
There are a couple of other new features.
takes an optional second argument allowing you to return just the latitude or longitude. The syntax is
=G_LATLNG(Location, optionNum). If you enter
optionNum as 0 you get both (this is the default if you don’t specify), 1 you get just the latitude, 2 just gives you the longitude.
Since the update, the
G_geocode() code module now allows you to specify
G_LATLNG(), G_LAT(), G_LONG() or
These give you options to return either latitude or longitude singly as well as as a pair.
G_ADDRESS() can be used for reverse geocoding – finding a full address from a latitude and longitude, or from a partial address. It is also useful for cleaning up and standardising addresses so that they can be compared with others, useful where there are spelling mistakes or inconsistencies in the way they have been entered in your data source.
The WebBrowser worksheet shows you the difference between a regular Google Map and a Google Static Map. Click on locations in the list and it will update the map automatically. You can play around with the parameters and see what they do. You can also replace the places in the Locations table with your own ones