Exporting query results using VBA

B

Brad

When you export a table or query in VBA, you use syntax
like this:

DoCmd.OutputTo acOutputQuery, "nameofquery",
acFormatXLS, "nameofdestinationfile"

The problem I have is that acFormatXLS is not specific
enough. acFormatXLS saves my documents as a Microsoft
5.0/95 Workbook. I need the XLS file to be saved as a
Microsoft Excel Workbook, or as a Microsoft Excel 97-2000
Workbook.
 
J

John Nurick

Hi Brad,

Use DoCmd.TransferSpreadsheet instead.

When you export a table or query in VBA, you use syntax
like this:

DoCmd.OutputTo acOutputQuery, "nameofquery",
acFormatXLS, "nameofdestinationfile"

The problem I have is that acFormatXLS is not specific
enough. acFormatXLS saves my documents as a Microsoft
5.0/95 Workbook. I need the XLS file to be saved as a
Microsoft Excel Workbook, or as a Microsoft Excel 97-2000
Workbook.

John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
 

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