Error in A2010 On OutputTo Code

jcruzAME

Registered User.
Local time
Today, 13:40
Joined
Oct 5, 2011
Messages
135
Code that runs fine in A2003 in 2010 gives this error:

"The format in which you are attempting to output the current object is not available."

The code is a
Code:
DoCmd.OutputTo acOutputQuery, "qryCompare", acSpreadsheetTypeExcel19, file name, false
.

At first I thought it was because the code was looking for the wrong location but it is correct. Most of the posts I came across while searching this error were unanswered or given solutions that didn't work. Figure I'd try my luck here.
 
Try using acSpreadsheetTypeExcel without the 19? Also, the file name argument doesn't look right. You should not have a space between file and name.
 

Users who are viewing this thread

Back
Top Bottom