Methods

add(fileName, sheetNames) → Number

Adds an external link.

Parameters

Name Type Optional Description

fileName

String

 

The external file name.

sheetNames

Array of String

 

All sheet names of the external file.

Returns

Number The position of the external name in this list.

add(directoryType, fileName, sheetNames) → Number

Add an external link .

Parameters

Name Type Optional Description

directoryType

Number

 

DirectoryType

fileName

String

 

the file name.

sheetNames

Array of String

 

All sheet names of the external file.

Returns

Number The position of the external name in this list.

clear()

Removes all external links. When removing external links, all formulas that reference to them will be removed too because the references become invalid.

clear(updateReferencesAsLocal)

Removes all external links. If references are required to be updated, references to external links in formulas will be changed to current workbook. For example, one cell's original formula is "='externalsource.xlam'!customfunction()", after removing external links, the formula will become "=customfunction()". If references are not required to be updated, all formulas with references to external links will be removed too because those references become invalid.

Parameter

Name Type Optional Description

updateReferencesAsLocal

boolean

 

Whether update all references of external links as references of current workbook itself.

get(index) → ExternalLink

Gets the ExternalLink element at the specified index.

Parameter

Name Type Optional Description

index

Number

 

The zero based index of the element.

Returns

ExternalLink The element at the specified index.

getCount()

Gets the number of elements actually contained in the collection.

iterator() → Iterator

Get an enumerator that iterates through this collection.

Returns

Iterator 

removeAt(index)

Removes the specified external link from the workbook. When removing the external link, all formulas that reference to it will be removed too because the references become invalid.

Parameter

Name Type Optional Description

index

Number

 

the index of the external link to be removed.

removeAt(index, updateReferencesAsLocal)

Removes the specified external link from the workbook. If references are required to be updated, references to external links in formulas will be changed to current workbook. For example, the external link to be removed is "externalsource.xlam" and it defines one custom function "customfunction()", one cell's original formula is "='externalsource.xlam'!customfunction()", after removing the formula will become "=customfunction()". If reference are not required to be updated, all formulas with reference to this external link will be removed too because those references become invalid.

Parameters

Name Type Optional Description

index

Number

 

the index of the external link to be removed.

updateReferencesAsLocal

boolean

 

Whether update all references of given external link to reference of current workbook itself.