Problem output to Excel with wrong special chars

vagueante

New member
Local time
Today, 06:56
Joined
Dec 23, 2008
Messages
5
Hi,


I'm trying to export a query output to an excel file, with the code bellow
Code:
DoCmd.OutputTo acOutputQuery, stDocName, acFormatXLS, cfilename
The problem it that some special chars like "ã", which are ok in the query view, in the output excel file are wrong (replaced by a Ć).
If i use
Code:
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, stDocName, cfilename
The chars are ok, but the design and look of the excel file when opened are fuzzy like a csv file, while when use the first option it looks ok, with gray column headers, etc

I tried to find everywhere the way to output the right way, but the only thing i managed to find was the acUTF8 and acUTF16 (in MS site there's no example...), to put as the Encoding option in the docmd.outputto line, but this seems to do nothing. The bad chars still there
Code:
DoCmd.OutputTo acOutputQuery, stDocName, acFormatXLS, cfilename, , , acUTF8

What can I do?

Thank you
 
I don't know if it will work (as I've not tried it with special characters) but try the code I have here on my website to send a table or query to Excel. I included some sample formatting code too which you can use or discard.
 
Thanxs, i'll try this later, meanwhile as a workaround, if i export to "XLSX" (2007 format), it export's ok (!!!), that forces to save in a old format before working the sheet (the machine that connects, only supports 2003)
 

Users who are viewing this thread

Back
Top Bottom