
06-12-2012, 07:25 AM
|
|
Newcomer
|
|
Join Date: Dec 2011
Posts: 7
|
|
Changing tablename in docmd.Transferspreadsheet in access VBA
|
Hi All,
Process: I have the below code which gets the base SQL statement and defines the working query. Based on this it then generates & exports Excel spreadsheet into a defined folder (wkfolder).
Objective: The exported workbook name is fine but the sheet-name comes up as "RunReport". I wish to change the sheetname to "UpdateData". Is this possible please?
QryDef = CurrentDb.QueryDefs("MyQuery").SQL
CurrentDb.QueryDefs("RunReport").SQL = QryDef
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "RunReport", wkFolder & "1002 Update 01_First Letter.xls"
|
|