XL2000: Unexpected Message: Update References to Unopened Documents (213454)



The information in this article applies to:

  • Microsoft Excel 2000

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: For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site: 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:
  1. Start Excel, and then press ALT+F11 to start the Visual Basic Editor.
  2. On the Insert menu, click Module.
  3. 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
    					
  4. Press ALT+F11 to return to Excel.
  5. On the Tools menu, point to Macro, and then click Macros.
  6. In the Macro name list, click Remove_Names, and then click Run.
NOTE: If your sheet names contain spaces, you may receive an error message when you attempt to delete the defined name.

Modification Type:MinorLast Reviewed:10/11/2006
Keywords:kbdtacode kbhowto kbprb kbProgramming KB213454