Excel dosyasındaki bilgilerimi kml dosyasına çevirmek istiyorum. Yardımcı olabilecek arkadaşlara teşekkür ederim.
yyhy, 18-05-2009 tarihinden beri AccessTr.neT üyesidir.
Sub ExportToKML()
Dim KML As String
Dim i As Long
KML = "<?xml version=""1.0"" encoding=""UTF-8""?>" & vbCrLf
KML = KML & "<kml xmlns=""http://www.opengis.net/kml/2.2"">" & vbCrLf
KML = KML & "<Document>" & vbCrLf
For i = 2 To Cells(Rows.Count, 1).End(xlUp).Row
KML = KML & "<Placemark>" & vbCrLf
KML = KML & " <name>" & Cells(i, 1).Value & "</name>" & vbCrLf
KML = KML & " <Point>" & vbCrLf
KML = KML & " <coordinates>" & Cells(i, 2).Value & "," & Cells(i, 3).Value & "</coordinates>" & vbCrLf
KML = KML & " </Point>" & vbCrLf
KML = KML & "</Placemark>" & vbCrLf
Next i
KML = KML & "</Document>" & vbCrLf
KML = KML & "</kml>"
Open "C:\Path\To\Your\File.kml" For Output As #1
Print #1, KML
Close #1
End Sub