Macro Error Changing Link with ! in Hard Drive Name (118882)



The information in this article applies to:

  • Microsoft Excel for Windows 95
  • Microsoft Excel for Windows 5.0c

This article was previously published under Q118882

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


Modification Type:MinorLast Reviewed:8/15/2005
Keywords:kberrmsg KB118882