Microsoft KB Archive/213454

= XL2000: Unexpected Message: Update References to Unopened Documents =

Article ID: 213454

Article Last Modified on 11/23/2006

-

APPLIES TO


 * Microsoft Excel 2000 Standard Edition

-



This article was previously published under Q213454





SYMPTOMS
When you open a Microsoft Excel 2000 spreadsheet, you may receive the following message:

Update References to Unopened Documents



CAUSE
This behavior can occur because in Excel, some macros and add-ins create hidden names on a worksheet. Hidden names may cause links to exist even after you attempt to remove all known references (including objects and formulas) from a worksheet.

When you open a worksheet containing a hidden link, you receive the message mentioned in the "Symptoms" section. The "More Information" section provides a macro to remove all of the hidden names in a workbook.



RESOLUTION
To resolve this issue, you can create a Microsoft Visual Basic for Applications macro to remove all of the hidden names in a workbook.



MORE INFORMATION
Microsoft 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 the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, please visit the following Microsoft Web site:

https://partner.microsoft.com/global/30000104

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

The following sample macro displays a message box that addresses the following three points:
 * Whether the defined name is visible or hidden
 * The defined name
 * What that name refers to (the workbook cell reference)

You may click Yes or No to delete or keep each defined name.

CAUTION: Removing names that contain links can eliminate errant links; however, doing so can also affect the integrity of your data and return unexpected results. Microsoft recommends that you create a backup of your workbook before running this macro, which may make changes to your data.

To create and run a macro to delete names and links (visible or hidden), follow these steps:  Start Excel, and then press ALT+F11 to start the Visual Basic Editor. On the Insert menu, click Module.  In the module sheet, type or paste the following code: Sub Remove_Names ' Dimension variables. Dim xName As Variant Dim Result As Variant Dim Vis As Variant ' Loop once for each name in the workbook. For Each xName In ActiveWorkbook.Names 'If a name is not visible (it is hidden)... If xName.Visible = True Then Vis = "Visible" Else Vis = "Hidden" End If       ' ...ask whether or not to delete the name. Result = MsgBox(prompt:="Delete " & Vis & " Name " & _           Chr(10) & xName.Name & "?" & Chr(10) & _            "Which refers to: " & Chr(10) & xName.RefersTo, _            Buttons:=vbYesNo) ' If the result is true, then delete the name. If Result = vbYes Then xName.Delete ' Loop to the next name. Next xName End Sub  Press ALT+F11 to return to Excel. On the Tools menu, point to Macro, and then click Macros.</li> In the Macro name list, click Remove_Names, and then click Run.</li></ol>

NOTE: If your sheet names contain spaces, you may receive an error message when you attempt to delete the defined name.

Keywords: kbdtacode kbhowto kbprb kbprogramming KB213454

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.