public class ExternalLinkCollection
extends java.lang.Object
implements java.lang.Iterable
Example
//Open a file with external links
Workbook workbook = new Workbook("book1.xls");
//Change external link data source
workbook.getWorksheets().getExternalLinks().get(0).setDataSource("d:\\link.xls");
| Modifier and Type | Method and Description |
|---|---|
int |
add(int directoryType,
java.lang.String fileName,
java.lang.String[] sheetNames)
Add an external link .
|
int |
add(java.lang.String fileName,
java.lang.String[] sheetNames)
Adds an external link.
|
void |
clear()
Removes all external links.
|
void |
clear(boolean updateReferencesAsLocal)
Removes all external links.
|
ExternalLink |
get(int index)
Gets the
ExternalLink element at the specified index. |
int |
getCount()
Gets the number of elements actually contained in the collection.
|
java.util.Iterator |
iterator()
Get an enumerator that iterates through this collection.
|
void |
removeAt(int index)
Removes the specified external link from the workbook.
|
void |
removeAt(int index,
boolean updateReferencesAsLocal)
Removes the specified external link from the workbook.
|
public int getCount()
public int add(java.lang.String fileName,
java.lang.String[] sheetNames)
fileName - The external file name.sheetNames - All sheet names of the external file.public int add(int directoryType,
java.lang.String fileName,
java.lang.String[] sheetNames)
directoryType - DirectoryType. The directory type of the file name.fileName - the file name.sheetNames - All sheet names of the external file.public ExternalLink get(int index)
ExternalLink element at the specified index.index - The zero based index of the element.public void clear()
Remarks
When removing external links, all formulas that reference to them will be removed too because the references become invalid.public void clear(boolean updateReferencesAsLocal)
Remarks
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".updateReferencesAsLocal - Whether update all references of external links in formulas to references of current workbook itself.public void removeAt(int index)
Remarks
When removing the external link, all formulas that reference to it will be removed too because the references become invalid.index - the index of the external link to be removed.public void removeAt(int index,
boolean updateReferencesAsLocal)
index - the index of the external link to be removed.updateReferencesAsLocal - Whether update all references of given external link to reference of current workbook itself.
Check clear(boolean) to get more details about this parameter.public java.util.Iterator iterator()
iterator in interface java.lang.IterableSee Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.
We guarantee a prompt response to any inquiry!
© Aspose Pty Ltd 2003-2025. All Rights Reserved.