top of page
  • White Facebook Icon
  • White Instagram Icon
Search

Google Earth 10 Type Library Vba: How to Solve the Missing Library Issue on Windows 8.1 and 10



I use the google earth API (Reference: Earth 1.0 Type Library)I start by taking the address information (from cell Tools.Range(rngGeocoderAddress)). I construct KML data for the point and send it to google earth (probably not necessary), I then execute a search on the address information. This will trigger google to start zooming the to resulting location.


In a loop, I periodically monitor google earth to see whether it is still in the process of zooming to a new location. Once it has stopped moving, I know that it has zoomed to the search result, and I can capture the Lat Long using GetPointOnTerrainFromScreenCoords(0,0)




Google Earth 10 Type Library Vba



I don't know i can replicate the problem with the double save i only get the Google Earth Save to Temporary folderit will mostly be either "C:\Program Files\Google\Google Earth Pro\googleearth.exe" or "C:\Program Files (x86)\Google\Google Earth Pro\googleearth.exe"


In other cases, code execution was straightforward. For example, the ProcessChain Class with CLSID E430E93D-09A9-4DC5-80E3-CBB2FB9AF28E that is implemented in C:\Program Files (x86)\Windows Kits\10\App Certification Kit\prchauto.dll. This COM class can be readily analyzed without looking at any disassembly listings, because prchauto.dll contains a TYPELIB resource containing a COM Type Library that can be viewed using Oleview.exe. Figure 7 shows the type library for ProcessChainLib, exposing a CommandLine property and a Start method. Start accepts a reference to a Boolean value.


VBA codeHere is the VBA code for the custom Elevation function. Have in mind that the use of the Google Elevation API is subject to a limit of 40,000 requests per month, so be careful not to exceed this limit.2018 Update: the function has been updated to reflect the changes in Google API. To use this VBA function you will need a valid API key. Check this link that presents a step-by-step guide on how to acquire one for free.Option ExplicitFunction GetElevation(Latitude As Double, Longitude As Double) As Variant '----------------------------------------------------------------------------------------- 'The function returns the elevation from a given location using the Google Elevation API. 'NOTE: As Google points out, the use of the Google Elevation API is subject to a limit 'of 40,000 requests per month, so be careful not to exceed this limit. For more info check: ' -platform/pricing/sheet 'In order to use this function you must enable the XML, v3.0 library from VBA editor: 'Go to Tools -> References -> check the Microsoft XML, v3.0. '2018 Update: In order to use this function you will now need a valid API key. 'Check the next link that guides you on how to acquire a free API key: ' -to-get-free-google-api-key.html 'Written By: Christos Samaras 'Date: 22/08/2013 'Last Updated: 09/08/2018 'E-mail: [email protected] 'Site: '----------------------------------------------------------------------------------------- 'Declaring the necessary variables. Using 30 at the first two variables because it 'corresponds to the "Microsoft XML, v3.0" library in VBA (msxml3.dll). Dim ApiKey As String Dim Request As New XMLHTTP30 Dim Results As New DOMDocument30 Dim StatusNode As IXMLDOMNode Dim ElevationNode As IXMLDOMNode 'Set your API key in this variable. Check this link for more info: ' -to-get-free-google-api-key.html ApiKey = "Your API Key goes here!" 'Check that an API key has been provided. If ApiKey = vbNullString Or ApiKey = "Your API Key goes here!" Then GetElevation = "Invalid API Key" Exit Function End If 'Checking if the latitude value is within the acceptable limits [-90, 90]. If Latitude 90 Then GetElevation = "Incorrect latitude value" Exit Function End If 'Checking if the longitude value is within the acceptable limits [-180, 180]. If Longitude 180 Then GetElevation = "Incorrect longitude value" Exit Function End If 'Generic error handling. On Error GoTo errorHandler 'Create the request based on Google Elevation API. Parameters (from Google page). '- Locations: defines the location(s) on the earth from which to return elevation data. 'This parameter takes either a single location as a comma-separated latitude,longitude pair '(e.g. "40.714728,-73.998672") or multiple latitude/longitude pairs passed as an array or as an encoded polyline. 'Here we use it with a "single location" format. 'Since we don't require a path, (but a single location) the parameter "path" is omitted here. Request.Open "GET", " " _ & "&locations=" & Latitude & "," & Longitude & "&key=" & ApiKey, False 'Send the request to the Google server. Request.send 'Read the results from the request. Results.LoadXML Request.responseText 'Get the status node value. Set StatusNode = Results.SelectSingleNode("//status") 'Based on the status node result, proceed accordingly. Select Case StatusNode.Text Case "OK" 'The API request was successful. 'Get the elevation node value. Set ElevationNode = Results.SelectSingleNode("//result/elevation") GetElevation = CDbl(ElevationNode.Text) Case "INVALID_REQUEST" 'The API request was malformed. GetElevation = "Request was malformed" Case "OVER_QUERY_LIMIT" 'The requestor has exceeded limit. GetElevation = "Requestor has exceeded limit" Case "REQUEST_DENIED" 'The API did not complete the request. GetElevation = "Request was denied" Case "UNKNOWN_ERROR" 'An unknown error occured. GetElevation = "Unknown error" Case Else 'Just in case... GetElevation = "Error" End Select 'In case of error, release the objects.errorHandler: Set StatusNode = Nothing Set ElevationNode = Nothing Set Results = Nothing Set Request = Nothing End FunctionDownloadsThe file can be opened with Excel 2007 or newer. Please enable macros before using it.


Note Regarding Datums: When setting a custom "ellipsoid" you aren't truly setting a datum point, but a reference ellipsoid.This library isn't designed for mapping and has no way of knowing how a coordinate correlates with an actual map.This is solely used to changed the earth's shape during calculations to increase accuracy in specific regions.In most cases the default datum value is sufficient. 2ff7e9595c


 
 
 

Recent Posts

See All
Baixe o Carrom Pool Disc Game

Baixe a versão mais recente do FR Legends Se você é fã de jogos de drifting, deve ter ouvido falar do FR Legends, um jogo para celular...

 
 
 

Comments


bottom of page