OutPutTo Code

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

Guest

I am using Access 2003 for my database and have code written to export data
into excel, the following code works in my program:

Private Sub ExportBtn_Click()
On Error GoTo ExportBtn_Click_Err
Call RetrieveBtn_Click

DoCmd.OutputTo acQuery, "qryQuickQueryCrosstab",
"MicrosoftExcelBiff8(*.xls)", "", True, "", 0

However when I try to run the database on a computer with a older version of
access the data will not export. Is there something wrong with the code or
are the older versions just not compatible?
 
Why don't you use

docmd.TransferSpreadsheet acExport ,acSpreadsheetTypeExcel5
,"YourQueryName","YourFilename",true

you can also change acSpreadsheetTypeExcel5 in other versions of excel but i
recommend this one for general compatibility

- Raoul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Error message with Macro 1
help , and double help 0
Export to Excel 3
output file 3
Exporting a Report to Excel 2
OutputTo pdf error 1
Sorting form thru code 1
CopyObject VBA Code Problem 1

Back
Top