Hi,
I have data from a data base that I export into excel and paste into an excel spreadsheet which formats the data to look presentable.
The data has a google maps location URL column and I would like to write some VBA based on the cells with the URL to insert a satellite image of this location into a shape on the formatted tap of the spreadsheet.
Is this possible? I have tried several things and no joy. I have even setup a Static maps API key to add to the URL but it just doesnt work. The most promising thing I have tried is:
With this I get the 'Run-time error '-2146697208 (800c0008)': Automation error The download of the specified resource has failed.
Example of a google maps URL in a cell:
https://www.google.co.uk/maps/@52.238951,-0.9039376,682m/data=!3m1!1e3?hl=en
Any help will be very much appreciated.
Thanks, Owain
I have data from a data base that I export into excel and paste into an excel spreadsheet which formats the data to look presentable.
The data has a google maps location URL column and I would like to write some VBA based on the cells with the URL to insert a satellite image of this location into a shape on the formatted tap of the spreadsheet.
Is this possible? I have tried several things and no joy. I have even setup a Static maps API key to add to the URL but it just doesnt work. The most promising thing I have tried is:
HTML:
Option Explicit
Sub insertMap()
Dim APIKey As String
Dim gAPIMapUrl As String
APIKey = "my key goes here"
gAPIMapUrl = Sheets(Sheet1).Cells("Y2").Value & "&key=" & APIKey
Shapes("Rectangle 1").Fill.UserPicture gAPIMapUrl
End Sub
With this I get the 'Run-time error '-2146697208 (800c0008)': Automation error The download of the specified resource has failed.
Example of a google maps URL in a cell:
https://www.google.co.uk/maps/@52.238951,-0.9039376,682m/data=!3m1!1e3?hl=en
Any help will be very much appreciated.
Thanks, Owain
Last edited: