Acc2003: Errors exporting to Excel

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In Access 2003, I'm trying to export a report to Excel.

When I try it programmatically using DoCmd.OutputTo, I get an error 3251,
with a useless description ("Reserved error" or something along those lines).

When I try it from the menu, I get no error but no file output either.

Other reports work fine.
Other formats work fine for this report (eg, RTF).

Can anyone help me solve this?
Thanks
 
Hi,
have you tried to actually output the underlying data source (query/table)
of this report instead? Outputting reports is normally just for creating a
static graphical representation (rtf, snp, pdf format). You could then also
try the TransferSpreadSheet method.
HTH
Good luck
 
Thanks freakazeud, outputting the query works.
I just have to find out if the client is happy with that option.
(I'm upgrading this database from Access 2, where exporting the report
worked!)
 
Well, the client doesn't like the way it outputs from the query.
Any ideas of what could be making it fail?

To recap:
It only fails on XLS export from some particular reports.
Exporting to RTF or other format works fine.
Exporting to XLS from other reports works fine.
(and exporting to XLS in the Access 2 version works fine!)
 
Finally fixed it.

I tracked it down to the Remarks field on the report. When I tried
Len([Remarks]) it gave an #Error result for some rows. I tried changing the
field to CStr(nz([Remarks])) on the report and it still gave errors. Returned
the report to normal, changed the Remarks field on the query to
CStr(nz([Remarks])), and now it works.

Can anyone explain to me how a value in a text field can be not a string???
 
Back
Top