Article ID: 108359 - Last Review: October 10, 2006 - Revision: 2.2 Cannot Define Name If Active Sheet ProtectedThis article was previously published under Q108359 On This PageSYMPTOMS
In Microsoft Excel, if the active sheet and its contents are protected, you
may not be able to do either of the following:
MORE INFORMATIONMicrosoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
To define a name when the active sheet and its contents are protected,
follow the appropriate procedure below.
Manually Define the NameUse the name box on the left side of the formula bar. For example, to define the new global name "Test" when the active sheet and its contents are protected:
NOTE: To protect a worksheet and prevent names from being created using the name box, disable the formula bar. NOTE: You cannot use this method to define a name in Microsoft Excel 97 or Microsoft Excel 98 Macintosh Edition when the active sheet is protected. Use Code to Define the NameUsing the Names.Add method or the DEFINE.NAME() macro command to define a name, you must first activate an unprotected sheet or unprotect the active sheet. If you want to add a defined name without unprotecting the worksheet, use code similar to the following sample Visual Basic for Applications macro.NOTE: In Microsoft Excel versions 5.0c and later, you can use a Visual Basic subroutine or Microsoft Excel 4.0 macro to define a name on a protected worksheet without first unprotecting the worksheet. The workaround shown above is necessary only in Microsoft Excel for Windows, version 5.0. REFERENCES
"User's Guide," version 5.0, pages 688-692
| Article Translations
|


Back to the top
