This documentation is archived and is not being maintained.

Workbook.ChangeLink Method

Changes a link from one document to another.

Namespace: Microsoft.Office.Tools.Excel
Assembly: Microsoft.Office.Tools.Excel (in

public virtual void ChangeLink (
	string Name,
	string NewName,
	[OptionalAttribute] XlLinkType Type



The name of the Microsoft Office Excel or DDE/OLE link to be changed, as it was returned from the LinkSources method.


The new name of the link.


One of the XlLinkType values that specifies the link type.

Optional Parameters

For information on optional parameters, see Understanding Optional Parameters in COM Interop.

The following code example creates an external link to an Excel workbook and then uses the ChangeLink method to change the link destination. This example assumes that workbooks Book2.xls and Book3.xls exist at the root of the C directory.

private void ChangeAllLinks()
    Globals.Sheet1.Range["A1", missing].FormulaR1C1 =

    this.ChangeLink(@"C:\Book2.xls", @"C:\Book3.xls",