Exporting non-Latin Characters from Excel

M

maurice.roach

Hi,

I'm very new to the world of Excel Macros and functions so please bear
with me.

I have cobbled together a VB function to export an XML document from
Excel, the function allows the user to choose a column for export.

The function will be used for multilingual export into various XML
documents and as such must be able to export data *exactly* as it is in
the Excel document. Problem is that all non-Latin characters are
exported as question marks "?".

The code that does the writting to the file is as follows:

Print #iFileNum, "<?xml version=""1.0""?>"
Print #iFileNum, "<" & sName & ">"
For i = 2 To lRows 'Starts at the second row
If Trim(Cells(i, 1).Value) = "" Then Exit For
' Print #iFileNum, "<" & RowName & ">"
Print #iFileNum, "<entry id=" & Chr(34) & Trim(Cells(i, 1).Value) &
Chr(34) & ">"

' For j = 1 To lCols

If Trim(Cells(i, 1).Value) <> "" Then
Print #iFileNum, "<![CDATA[";
' Print #iFileNum, Trim(Cells(i, colID).Value);
Print #iFileNum, Cells(i, colID).Value;
Print #iFileNum, "]]>";
DoEvents 'OPTIONAL
End If
' Next j
Print #iFileNum, " </entry>"
Next i

Print #iFileNum, "</" & sName & ">"

My question is how do I export the non-Latin values to the XML
document?

Any help or pointers would be greatly appreciated.

Best regards
Maurice
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top