Question : Removing apostrohies from exported excel cells

I have a database that I need to export to excel. I have tried it to ways.

(1) I run a report and then click on my custon toolbar and it spits the headers with associated data to excel

(2) The other is using this command.

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "qrySetoff", "C:\Setoff.xls"

When I use #1 some of the date fileds that have leading zeros are gone when it's exported.

If I use #2 it's perfect except that every field has an apostrophy at the beginning of each field.

I need the leading zeros and I want to make it easy for users to run the export as needed.

Can you tell me how to remove the apostrophies or add the zeros back in #1.

Thanks

Chris C

Answer : Removing apostrohies from exported excel cells

Sorry... I have some extraneous quotes in that:

docmd.OutputTo acOutputQuery,"qrySetoff", ,acSpreadsheetTypeExcel9, "C:\Setoff.xls",true
Random Solutions  
 
programming4us programming4us