Output To Excel defaults to version 5-7/want Excel 10

G

Guest

TIA:

In my code:
DoCmd.OutputTo acOutputQuery, "qryCNdataall", acFormatXLS, "c:\" & name &
".xls", False

The file is Excel 5-7 format.

How might I get the file saved as Excel 10?

Thanks,
Joel
 
R

Rick Brandt

Joel said:
TIA:

In my code:
DoCmd.OutputTo acOutputQuery, "qryCNdataall", acFormatXLS, "c:\" & name &
".xls", False

The file is Excel 5-7 format.

How might I get the file saved as Excel 10?

Use TransferSpreadsheet instead of OutputTo. TransferSpreadsheet allows you to
specify the Excel version.
 
G

Guest

Thanks but I believe I can only export tables and I am exported data from a
query...any other way other than having to create tables from query?

Joel
 
R

Rick Brandt

Joel said:
Thanks but I believe I can only export tables and I am exported data from a
query...any other way other than having to create tables from query?

The third argument for TransferSpreadsheet (TableName) is poorly named. You can
use it for exporting saved select queries as well.
 
G

Guest

Thanks for the insight...Joel

Rick Brandt said:
The third argument for TransferSpreadsheet (TableName) is poorly named. You can
use it for exporting saved select queries as well.
 

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

Top