Hello,

Here's an example of opening a location in Google Earth directly from MS Excel using a VBA macro.

The spreadsheet contains a data sheet - wth names, lan/long pairs and descriptions - and a control sheet with the kml code and file details. Click on the "Open in GE" link on a row to open those co-ordinates in directly in GE.

Make sure that the "temp dir" value is set to a suitable temporary directory and that the path to the GE executable is correct (this will probably be different to the default if you are using GE Pro; I've put little error handling in so the macro will just break if it's not right).

See also the Excel to KML converter, which creates a kml file for all locations in a spreadsheet:
http://bbs.keyhole.com/ubb/showthreaded.php/Cat/0/Number/613667

Disclaimer: This is provided 'as is' with no support or guarantees etc. Care should be taken opening any file including a macro - I've no reason to suspect that it contains a virus (I should hope not - that means my PC is infected!) but I still suggest scanning with an anti-virus tool just in case.



Simon.


Attachments
774351-GEfromExcel.zip (8007 downloads)
Preview this file with the Google Earth Plugin (learn more)


Edited by simon_a (01/28/07 02:54 PM)