Microsoft KB Archive/125958

= Microsoft Knowledge Base =

XL: Delete Method Deletes Local Name When Sheet Is Forward
Last reviewed: March 27, 1997

Article ID: Q125958

5.00 5.00c 7.00 7.00a | 5.00 5.00a

WINDOWS              | MACINTOSH kbusage

The information in this article applies to:


 * Microsoft Excel for Windows, versions 5.0, 5.0c
 * Microsoft Excel for the Macintosh, versions 5.0, 5.0a
 * Microsoft Excel for Windows 95, versions 7.0, 7.0a

SYMPTOMS
In Microsoft Excel, when you use the Delete method to delete defined names, if a worksheet has a local name that is the same as a global name, the local name is deleted when the sheet is the first sheet in the workbook or is the top-most sheet (even if the sheet not the active sheet). However, when the sheet is not the first or top-most sheet in the workbook, the global version of the name is deleted.

CAUSE
The local name in the worksheet that is forward on the screen takes precedence over the global names and is deleted first. This occurs regardless of whether the workbook is active.

WORKAROUND
If you're not sure whether the global name or a local name is being deleted, you can use a macro to loop through all of the names in the workbook and see if there is an exclamation point in the name. If one is found, then the name is a local name which would be deleted first.

RESOLUTION
Microsoft has confirmed this to be a problem in the versions of Microsoft Excel version listed above. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.