Microsoft Knowledge Base
XL5: Change.Link?() Function Returns Macro Error or #VALUE
Last reviewed: September 12, 1996
Article ID: Q124669
The information in this article applies to:
- Microsoft Excel for Windows, versions 4.0, 5.0, 5.0c
- Microsoft Excel for Windows NT, version 5.0
- Microsoft Excel for the Macintosh, versions 4.0, 5.0
SYMPTOMS
In Microsoft Excel 5.0 Help, and on page 48 of the "Microsoft Excel Function Reference," version 4.0, the description for Microsoft Excel 4.0 CHANGE.LINK?() macro function lists the following arguments as optional:
old_text new_text type_of_link
(The Function Reference also states that the "old_text" argument is assumed to be the active workbook if it is omitted.)
This information is incorrect. If the CHANGE.LINK?() function is called without arguments, your macro will halt and will display a "macro error" error message. If error checking is turned off, by adding the =ERROR(false) statement, then CHANGE.LINK?() will return the #VALUE error value.
WORKAROUNDS
To work around this problem, follow the appropriate procedure below to pass the first argument, "old_text", to the CHANGE.LINK?() function.
Method 1: If you are using Microsoft Excel for Windows, use the following
statement =CHANGE.LINK?("C:\EXCEL\FILENAME.XLS") where C:\EXCEL\FILENAME.XLS is the full path to the file (source) to which your worksheet (dependent) is linked. This use of the CHANGE.LINK?(old_text) function will bring up the Change Links To dialog box, and you can select the file to which you want your link changed.
Method 2: If you are Microsoft Excel for the Macintosh, use the following
statement =CHANGE.LINK?("Hard_Disk_Name:Excel:Filename") where Hard_Disk_Name:Excel:Filename is the full path to the file (source) to which your worksheet (dependent) is linked. This use of the CHANGE.LINK?("old_text") function will bring up the Change Links To dialog box, and you can select the file to which you want your link changed.
KBCategory: kbcode kbmacro kbdocerr Last reviewed: September 12, 1996 |