DoCmd.OutputTo Question

D

David

When I run the following command to export data to Excel, I get the following
error message when I open the Excel spreadsheet. "File Error. Some number
formats may have been lost."

The command is:

DoCmd.OutputTo acOutputQuery, "qryGetMasterFromCriteria", acFormatXLS,
strExportLocation

Any ideas?
 
F

fredg

When I run the following command to export data to Excel, I get the following
error message when I open the Excel spreadsheet. "File Error. Some number
formats may have been lost."

The command is:

DoCmd.OutputTo acOutputQuery, "qryGetMasterFromCriteria", acFormatXLS,
strExportLocation

Any ideas?

Haven't a clue.
But try the TransferSpreadsheet method and see it that works without
the error..

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel97,
"qryGetMasterFromCriteria", strExportLocation,True

Look it up in VBA help for all of the arguments.
 
Top