ChangeLink Method

Applies To

Workbook Object.

Description

Changes a link from one document to another.

Syntax

object.ChangeLink(name, newName, type)

object

Required. The Workbook object.

name

Required. Specifies the name of the Microsoft Excel or DDE/OLE link to change, as returned from the LinkSources method.

newName

Required. The new name of the link.

type

Optional. Specifies the link type (either xlExcelLinks or xlOLELinks). If omitted, the default is xlExcelLinks. Use xlOLELinks for both DDE and OLE links.

Example

This example changes a Microsoft Excel link.


ActiveWorkbook.ChangeLink "c:\excel\book1.xls", _
    "c:\excel\book2.xls", xlExcelLinks