Darryl Collins
darryl at whittleconsulting.com.au
Mon Apr 1 17:17:31 CDT 2013
You would be better off using "SheetCodeName" rather than "Sheet.Name". The code name keeps the reference even if the user changes the sheet name. Let me know if you need more help with this. Cheers Darryl. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks Sent: Tuesday, 2 April 2013 8:21 AM To: Access Developers discussion and problem solving Subject: [AccessD] Reading Data from Excel into Access Where the Excel Worksheet Name Changes All, We have an Access 2007 application that pulls data from several sources, including an Excel file. There are several worksheets in the Excel file, but data is only pulled from one worksheet. There is some complexity in the current process because the name of the worksheet changes. We do not have control over this name. I have been thinking about a better/different approach. Is there some way in Access VBA code to change the name of an Excel Worksheet? This step could be done prior to the main processing. We could make a copy of the master Excel file and then work with our own copy. I am curious if others have run into this issue when working with Excel files and I am curious if there are ideas on how to better deal with this. Thanks, Brad -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com