XL: Link Broken Moving WorkSheet Linked to Function ProcedureLast reviewed: September 13, 1996Article ID: Q109186 |
The information in this article applies to:
SYMPTOMSIn Microsoft Excel, if you move a worksheet that contains a link to a function procedure, and then move the module containing the function procedure to a new workbook, the worksheet cell containing the link to the function procedure may display the #NAME error value.
CAUSEIf you move a worksheet containing a link to a function procedure, and then move the module containing the function procedure to a new workbook, the link to the function procedure is lost. As long as the original worksheet remains open, and you do not recalculate the cell containing the link, the result of the function procedure is displayed in the cell that contains the link. However, if you recalculate the cell containing the link, the #NAME error value is displayed in the cell containing the link. For example, if the workbook and module you move are the only sheets contained in the workbook, the workbook closes when the last sheet is moved without saving any changes and the link is lost.
WORKAROUNDTo move a worksheet containing a link to a function procedure and the module containing the function procedure to another workbook while maintaining the link, move both sheets at the same time as follows:
MORE INFORMATIONWhen you enter a user-defined function in a worksheet, you can enter a function contained in any open workbook. To enter a user-defined function that is contained in the current workbook, you can use just the function name, for example =Test(). However, to enter a user-defined function that is contained in another workbook, you must include the workbook name, for example =BOOK1.XLS!Test(). When you use the Function Wizard to insert a function, the available functions are listed with the correct reference. When you move a worksheet that contains a link to a user-defined function that is contained in the same workbook, the link is broken if the reference to the function is using the function name only. Even if the module containing the function procedure is then moved to the workbook with the worksheet containing the link, the function cannot be referenced using just the function name. Once the module containing the function is moved, the function must be referenced with the module name and the function name, for example, =Module1.Test(). To insert the function with the correct reference automatically, do the following:
For more information about entering a user-defined function in a worksheet or an overview of creating a user-defined function, choose the Search button in Help and type the following:
user-defined functions |
KBCategory: kbusage
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |