XL: Macro Error Changing Link with ! in Hard Drive Name

Last reviewed: September 13, 1996
Article ID: Q118882
The information in this article applies to:
  • Microsoft Excel for Windows, versions 5.0, 5.0c
  • Microsoft Excel for Windows 95, version 7.0

SYMPTOMS

In Microsoft Excel, when you use the CHANGE.LINK function to change the source of a link in your workbook, you receive a macro error if the name of your hard drive contains an exclamation point (!). If you use the ChangeLink method, and the name of your hard drive contains an exclamation point, you receive the following error message:

   Run-time error '1004':

   ChangeLink method of Workbook class failed

This problem does not occur in Microsoft Excel version 4.0.

WORKAROUND

To change the source of a link in your worksheet, when the name of your hard drive contains an exclamation point, do either of the following:

  • Use the Links dialog box by doing the following:

  1. From the Edit menu, choose Links.

  2. Select the link you want to change, and choose the Change Source button.

  3. Select the desired workbook you for the source, and choose Change.

  4. In the Links dialog box, choose Close.

    -or-

  • Change the source by using a macro or Visual Basic procedure, and rename your hard drive so that it does not contain an exclamation point.

    STATUS

    Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

    REFERENCES

    For more information about CHANGE.LINK, choose the Search button in Help and type:

       CHANGE.LINK function
    

  • KBCategory: kbprg
    KBSubcategory: kberrmsg

    Additional reference words: 5.00 5.00c 7.00 err msg



    THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

    Last reviewed: September 13, 1996
    © 1998 Microsoft Corporation. All rights reserved. Terms of Use.