Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with XLS file Generated by OutputTo Method

Status
Not open for further replies.

dougcoulter

Programmer
Mar 16, 2001
112
US
I am trying to export a couple of reports to Excel using the DoCmd.OutputTo method of Access 2002. It appears to work fine, but when I try to open the XLS file, Excel crashes. I have tried opening it on several different PCs with different versions of Excel. I have also checked out Microsoft's Knowledge Base to no avail. Has anyone else seen this problem?
 
Try using this alternate command:

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel97, WrkTbl, ExportFile

Where Wrktbl is the variable holding the tablename and Exportfile is the variable holding the destination & output name.

Using excel97 type make it more portable.

 
It appears the TransferSpreadsheet method works only with tables and queries as opposed to reports (?)

I did play a little more with the OutputTo method, and it seems the XLS file generated locks up due to some simple aggregates (summations) on sections (i.e. group aggregates and report aggregates). When I remove them from the report and run my function, the generated XLS file works just fine. Unfortunately, I need the aggregates!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top