Hello
I have an Excel file which allows a user to enter some data about an address and for a sheet in the Excel to build out a full KML file.
Here's what I'd like to achieve:
User to select the button, the VBA to export everything in a specific column on the worksheet (Final KML) as a KML file. User to be prompted where to save the file.
I have most of what I need with the below code.
However, I am getting stuck because the below code:
1. Removes all the special characters; my content is in Japanese and I need this to persist into the KML file
2. Trims the cells due breaching a max character length
I changed xlTextPrinter to be xlUnicodeText. However, UnicodeText adds is comma delimited and adding quotation marks and 'header' and 'footer' to the output.
Can someone please help me rejig so that:
(1) allows special characters, (2) does not trim the cells, (3) has no extra quotation marks, (4) has no header/footer tags in the output.
Thank you so much!
I have an Excel file which allows a user to enter some data about an address and for a sheet in the Excel to build out a full KML file.
Here's what I'd like to achieve:
User to select the button, the VBA to export everything in a specific column on the worksheet (Final KML) as a KML file. User to be prompted where to save the file.
I have most of what I need with the below code.
However, I am getting stuck because the below code:
1. Removes all the special characters; my content is in Japanese and I need this to persist into the KML file
2. Trims the cells due breaching a max character length
I changed xlTextPrinter to be xlUnicodeText. However, UnicodeText adds is comma delimited and adding quotation marks and 'header' and 'footer' to the output.
Can someone please help me rejig so that:
(1) allows special characters, (2) does not trim the cells, (3) has no extra quotation marks, (4) has no header/footer tags in the output.
Thank you so much!
Code:
<code class="prettyprint prettyprinted" style="">Private Sub CommandButton1_Click()
Application.DisplayAlerts = False
Dim wb As Workbook, InitFileName As String, fileSaveName As String
InitFileName = ThisWorkbook.Path & "\Export nr1_" & Format(Date, "yyyymmdd")
Sheets("Final KML").Copy
Set wb = ActiveWorkbook
fileSaveName = Application.GetSaveAsFilename(InitialFileName:=InitFileName, _
fileFilter:="KML Files (*.kml), *.kml")
With wb
If fileSaveName <> "False" Then
.SaveAs fileSaveName, FileFormat:=xlTextPrinter, Local:=True
.Close
Else
.Close False
Exit Sub
End If
End With
End Sub</code>