Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2006

Tip: Looking for answers? Try searching our database.

Sheet name change

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
spacecityguy - 24 Jan 2006 22:38 GMT
Is there a way to detect sheet name changes or prevent user from
changing the name of a sheet? Thanks.

Signature

spacecityguy

Tim Williams - 24 Jan 2006 22:59 GMT
You could protect the workbook.
Alternatively, if the problem with the changing sheet names is related to
referencing the sheets in VBA, use the sheet codename instead.

Eg:

   Sheet1.Range("A1")
instead of
   ThisWorkbook.Sheets("Sheet1").Range("A1")

Tim.

Signature

Tim Williams
Palo Alto, CA

> Is there a way to detect sheet name changes or prevent user from
> changing the name of a sheet? Thanks.
spacecityguy - 27 Jan 2006 21:10 GMT
I can't protect the workbook becuase I've to allow the user to input
into my file. I do use the sheet's codename in my code, and the problem
I have is with something that Excel may not expect me to do. I tried to
write a "patch" utility in VBA that will replace a sheet in a file
(template file) that has VBA code. Since I can't change the sheet's
codename, my code in the template file must refer to the sheet by its
"given" name (otherwise my code in the template file will break after
my patch deletes the sheet). But when I use the "given" name, I've to
worry about the user changing it. Thanks again.

Signature

spacecityguy

Tim Williams - 28 Jan 2006 00:52 GMT
I *think* you can change the sheet's codename using VBA.

If not, you might consider adding a hidden name to the inserted sheet and
then identify it by checking each sheet for the name.

Tim

Signature

Tim Williams
Palo Alto, CA

> I can't protect the workbook becuase I've to allow the user to input
> into my file. I do use the sheet's codename in my code, and the problem
[quoted text clipped - 5 lines]
> my patch deletes the sheet). But when I use the "given" name, I've to
> worry about the user changing it. Thanks again.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.