Rename Sheet1 on Excel Export

T

Tom

Hi

Am using Access 2002 and running the following query to export data to Excel
2002:

DoCmd.OutputTo acOutputQuery, "qryTestDbXls", acFormatXLS,
"C:\Temp\TestDb.xls", False

This works OK but sheet1, in Excel is also named qryTestDbXls and I would
like it to be called TestA.

How can this be achieved?

TIA

Tom
 
G

Guest

Use the TransferSpreadsheet method rather than the OutputTo.

The last argument is Range. Help says using in for an export will fail, but
this is not true. Put the name you want for the sheet in that arguement.
 

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