Article ID: 160327 - Last Review: November 23, 2006 - Revision: 2.4 XL97: Defined Names Are Case Sensitive in Microsoft Excel 97This article was previously published under Q160327 SUMMARY
When you run a Visual Basic for Applications macro in Microsoft Excel 97,
and your macro code reads the Name property of an item in the Names
collection, the result may be slightly different than the result you
receive in earlier versions of Microsoft Excel. This behavior occurs
because defined names are case sensitive in Microsoft Excel 97.
This article explains the new behavior and the problems it may cause. MORE INFORMATIONMicrosoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals 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 needs. If you have limited programming experience, you may want to contact a Microsoft Certified Partner or Microsoft Advisory Services. For more information, visit these Microsoft Web sites: Microsoft Certified Partners - https://partner.microsoft.com/global/30000104 (https://partner.microsoft.com/global/30000104) Microsoft Advisory Services - http://support.microsoft.com/gp/advisoryservice (http://support.microsoft.com/gp/advisoryservice) For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS (http://support.microsoft.com/default.aspx?scid=fh;en-us;cntactms) When you define names in a workbook in Microsoft Excel, the workbook cannot contain two or more defined names that differ from each by only the case of some or all of their letters. For example, you cannot create the following defined names in the same workbook:
Test
Although the names use different combinations of uppercase and lowercase
letters, the letters in each name are all the same. Therefore, Microsoft
Excel considers these four names to be identical. Defining a name in a
workbook when another identical name (except for the case) already exists
results in the elimination of the original name. For example, if you define
the name test, Microsoft Excel eliminates
the name Test from the workbook.
test tEST TEST In Microsoft Excel, you can check the name of a defined name by using Visual Basic for Applications macro code similar to the following: To demonstrate the difference in behavior, run the following subroutine:
MsgBox Value in MsgBox Value in
Defined name Microsoft Excel 97 Microsoft Excel 5.0, 7.0
------------------------------------------------------------
test test test
Test Test test
tEST tEST test
TEST TEST test
| Article Translations
|

Back to the top
