There are several workarounds to this issue. One is create a new QueryDef
using DAO with the name of the worksheet you desire and then set the SQL
property to SQL property of your current query.
A second approach would be to open Excel from Access using automation, and
rename the workbook. Since you already know the worksheet name and have the
file path to the workbook, this is straightforward.
A third approach, although I have not tested it, is to just temporarily
rename the query prior to export (using DAO) and then change the query name
back to its original name after exporting.
--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com
This response is supplied "as is" without any representations or warranties.
When exporting a query to Excel, is there a way to override the name of the
worksheet in Excel. Excel uses the query name by default. Thanks!