Change Excel sheet name in Access VBA

LB79

Registered User.
Local time
Today, 09:21
Joined
Oct 26, 2007
Messages
505
Hi all,

Please can anyone tell me if there is a way to change the sheet name of an Excel file that I am exporting from Access (using VBA).

Thanks
 
Try

Code:
    Sheets("Sheet1").Select
    Sheets("Sheet1").Name = "fred"
 
Hi DCrake - Happy new year!
Thanks for the reply but Im not sure how to incorporate that into my Access VBA.
Currently Im exporting to Excel using DoCmd.TransferSpreadsheet which automatically names the Excel sheet the same as the query.
 
You may have to look at either populating an existing workbook or opening the workbook blindly and renaming the sheet or rename your query the name of the worksheet you want.
 

Users who are viewing this thread

Back
Top Bottom