This documentation is archived and is not being maintained.

Workbook.ChangeLink Method

Office 2007
Changes a link from one document to another.

Syntax

expression.ChangeLink(Name, NewName, Type)

expression   A variable that represents a Workbook object.

Parameters

NameRequired/OptionalData TypeDescription
NameRequiredStringThe name of the Microsoft Excel or DDE/OLE link to be changed, as it was returned from the LinkSources method.
NewNameRequiredStringThe new name of the link.
TypeOptionalXlLinkTypeThe link type.

Example

This example changes a Microsoft Excel link.

Bb223228.vs_note(en-us,office.12).gif  Note
This example assumes at least one formula exists in the active workbook that links to another Excel source.
Visual Basic for Applications
ActiveWorkbook.ChangeLink "c:\excel\book1.xls", _
    "c:\excel\book2.xls", xlExcelLinks



Show: