Need help on macro command


Posted by Vermeer Paul on September 24, 2001 1:43 AM

Dear,

I'm trying to convert a program written for EXCEL 3.0 on MAC to EXCEL 2000 for PC...

Many problems are yet fixed, but there is on item i cannot understand cause i'm missing the help file..

Can anyone explain me the result of a CHANGE.LINK() command ?

paul.vermeer@isdg.be

Best regards



Posted by dan on September 24, 2001 10:36 AM

This is a command to change a links reference from one sheet/workbook to another when both are known.

Straight from Excel help...
ChangeLink Method

Changes a link from one document to another.

Syntax

expression.ChangeLink(Name, NewName, Type)

expression Required. An expression that returns a Workbook object.

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

NewName Required String. The new name of the link.

Type Optional Variant. The link type. Can be one of the following XlLinkType constants: xlLinkTypeExcelLinks or xlLinkTypeOLELinks. The default value is xlLinkTypeExcelLinks. Use xlLinkTypeOLELinks for both DDE and OLE links.


example...
ChangeLink Method Example

This example changes a Microsoft Excel link.

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