Problem exporting to Excel

Valerie

Registered User.
Local time
Today, 06:14
Joined
May 7, 2003
Messages
65
I am working with Office XP and have exported a query to Excel using the command

DoCmd.OutputTo acOutputQuery, "OrderForm", acFormatXLS, "C:\AMLocal\OrderForm.xls"

This correctly creates the excel file, but when I open the file I see the message "File Error. Some number formats may have been lost"

Clicking OK to message is fine and the file is correct. BUT I am using this file in a Word mail merge and the error message is causing a problem with the mail merge.

Thanks
 
;) Hello Valerie!
Try this
DoCmd.OutputTo acOutputQuery, "YourQueryName", acFormatXls, "Path name"

"Query name" instead "FormName"
 
I know its confusing - but the query name is actually "OrderForm"!

However - I seem to have solved my problem.

I have changed the order of the fields in the query so that the first field is a text field rather than a autonumber field - the error message has now gone away.
 

Users who are viewing this thread

Back
Top Bottom