ExternalLinkCollection
Source: aspose.
Represents external links collection in a workbook.
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
-
NumberThe 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
-
NumberThe 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, those references of external links in formulas will be changed to current workbook when it is possible. For example, one cell's original formula is "='externalsource.xlam'!customfunction()", after removing external links, the formula will become "=customfunction()"; When the original formula is "='[externalsource.xlam]Sheet1'!$A$1", according to whether there is one sheet with name "Sheet1" in current workbook: if true, the formula will become "=Sheet1!$A$1"; if false, the formula will become "=#REF!$A$1". 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 in formulas to 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
-
ExternalLinkThe 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.
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. Check |