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.
 
Top