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
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

Workbook.LinkInfo Method (2007 System)

Gets the link date and update status.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v9.0 (in Microsoft.Office.Tools.Excel.v9.0.dll)

public Object LinkInfo(
	string Name,
	XlLinkInfo LinkInfoArgument,
	Object Type,
	Object EditionRef


Type: System.String

The name of the link.

Type: XlLinkInfo

One of the XlLinkInfo values that specifies the type of information to return.

Type: System.Object

One of the XlLinkInfoType values that specifies the type of link to return information for.

Type: System.Object

If the link is an edition, this parameter specifies the edition reference as a string in R1C1 style. EditionRef is required if there is more than one publisher or subscriber with the same name in the workbook.

Return Value

Type: System.Object
A value that indicates information about the link. If LinkInfoArgument is xlUpdateState, this method returns 1 if the link updates automatically, or 2 if the link must be updated manually.

Optional Parameters

For information on optional parameters, see The Variable missing and Optional Parameters in Office Solutions.

The following code example uses gets the collection of DDE/OLE links in the current workbook, and then uses the LinkInfo method to determine whether or not each DDE/OLE link updates automatically or manually.

This example is for a document-level customization.

private void WorkbookLinkInfo()
    // Get the collection of DDE/OLE links in the workbook.
    Array links = (Array)this.LinkSources(Excel.XlLink.xlOLELinks);

    // If there are DDE/OLE links, then display how each link 
    // updates. 
    if (links != null)
        for (int i = 1; i <= links.Length; i++)
            string linkName = (string)links.GetValue(i);
            int updateValue = (int)this.LinkInfo(linkName,

            if (updateValue == 1)
                MessageBox.Show(linkName + " link updates automatically.");
            else if (updateValue == 2)
                MessageBox.Show(linkName + " link updates manually.");
        MessageBox.Show("The workbook contains no DDE/OLE links.");

Community Additions

© 2015 Microsoft