Convert Excel file to KML file

vasili86 Posted messages 2 Registration date   Status Membre Last intervention   -  
 IngenieurEE -
Hello,
I am a beginner in VBA and I need to create a KML file for an application in Google Earth from an Excel file. To do this, I have created a graphical interface with a button that allows me to save the KML file to a chosen location. However, I haven't found a code to convert an Excel file into a KML file, which is why I'm reaching out for your expertise; perhaps you could help me out, thank you in advance!

6 réponses

eriiic Posted messages 24581 Registration date   Status Contributeur Last intervention   7 281
 
Hello,

I wouldn't say it's impossible since a KML file is just a text file.

You still need to know what to put in it, so there's significant preparatory work involved.
Here you can find a description and the syntax of KML files: https://developers.google.com/maps/documentation/javascript/kmllayer?hl=en
But I find it hard to believe that with a bit more searching online you wouldn't find a pre-made file that does this.
On the Google forum, for example: https://productforums.google.com/forum/#!searchin/gec/excel
Yours has the particularity of displaying a table in the description. But for someone used to creating HTML pages, it shouldn't pose too many difficulties (?)

And rather than creating a KML file, maybe you can use the Google Earth APIs directly: https://cloud.google.com/maps-platform/?hl=en
But I think there might be a limitation on the number of data sent or the number of requests in a certain timeframe, worth checking out.

To encourage contributors, you should upload an XLS file with 3-4 points and the corresponding KML file.

Eric

Edit: https://accounts.google.com/ServiceLogin?passive=1209600&continue=https://sites.google.com/site/tekgergedan/home/xls2kml&followup=https://sites.google.com/site/tekgergedan/home/xls2kml

You will never respond to an unsolicited DM...
Well, that's done.
5