1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| --------------------------------------------------------------------------
Private Sub CommandButton1_Click()
Dim file As String
file = TextBox1.Value
ou_copier (file)
End Sub
--------------------------------------------------------------------------
Sub ou_copier(fileName As String)
Dim i As Integer
Open fileName For Output As #1
Print #1, "<?xml version=""1.0""encoding=""UTF - 8""?>"
Print #1, "<kml xmlns=""http://earth.google.com/kml/2.1"">"
For i = 1 To 100
Print #1, "<LookAt> <longitude>"; Cells(i, 1); "</longitude>"
Print #1, "<latitude>"; Cells(i, 2); "</latitude>"
Print #1, "<altitude>"; Cells(i, 3); "</altitude>"
Print #1, "<heading>"; Cells(i, 6); "</heading>"
Print #1, "<tilt>"; Cells(i, 4); "</tilt>"
Print #1, "<range>"; Cells(i, 5); "</range>"
Print #1, "<altitudeMode>absolute</altitudeMode>"
Print #1, "</LookAt>"
Next i
Print #1, "</kml>"
Close #1
End Sub
-------------------------------------------------------------------------- |
Partager