Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

Workbook.UpdateLink Method

Updates a Microsoft Office Excel, DDE, or OLE link (or links).

Namespace:  Microsoft.Office.Tools.Excel
Assemblies:   Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)
  Microsoft.Office.Tools.Excel.v4.0.Utilities (in Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)

void UpdateLink(
	Object Name,
	Object Type


Type: System.Object

The name of the Excel or DDE/OLE link to be updated, as returned from the LinkSources method.

Type: System.Object

One of the XlLinkType values.

When this method is called without any parameters, Excel defaults to updating all worksheet links.

Optional Parameters

For information on optional parameters, see Optional Parameters in Office Solutions.

The following code example creates an external link to an Excel workbook and then uses the UpdateLink method to update the link. This example assumes that workbook Book2.xlsx exists at the root of the C directory.

private void WorkbookUpdateLink()
    Array links = (Array)this.LinkSources(Excel.XlLink.xlExcelLinks);

    if (links != null)
        for (int i = 1; i <= links.Length; i++)
        MessageBox.Show("The workbook contains no links to " +
            "other workbooks.");

© 2015 Microsoft