Class ExcelExternalLinksCollection
- Namespace
- OfficeOpenXml.ExternalReferences
- Assembly
- EPPlus.dll
A collection of external links referenced by the workbook.
public class ExcelExternalLinksCollection : IEnumerable<ExcelExternalLink>, IEnumerable
- Inheritance
-
ExcelExternalLinksCollection
- Implements
- Inherited Members
Properties
Count
Gets the number of items in the collection
public int Count { get; }
Property Value
Directories
A list of directories to look for the external files that cannot be found on the path of the uri.
public List<DirectoryInfo> Directories { get; }
Property Value
this[int]
The indexer for the collection
public ExcelExternalLink this[int index] { get; }
Parameters
index
intThe index
Property Value
Methods
AddExternalWorkbook(FileInfo)
Adds an external reference to another workbook.
public ExcelExternalWorkbook AddExternalWorkbook(FileInfo file)
Parameters
file
FileInfoThe location of the external workbook. The external workbook must of type .xlsx, .xlsm or xlst
Returns
- ExcelExternalWorkbook
The ExcelExternalWorkbook object
Clear()
Clear all external links and break any formula links.
public void Clear()
GetEnumerator()
Returns an enumerator that iterates through the collection.
public IEnumerator<ExcelExternalLink> GetEnumerator()
Returns
- IEnumerator<ExcelExternalLink>
An enumerator that can be used to iterate through the collection.
LoadWorkbooks()
Will load all external workbooks that can be accessed via the file system. External workbook referenced via other protocols must be loaded manually.
public bool LoadWorkbooks()
Returns
- bool
Returns false if any workbook fails to loaded otherwise true.
Remove(ExcelExternalLink)
Removes the external link from the package.If the external reference is an workbook any formula links are broken.
public void Remove(ExcelExternalLink externalLink)
Parameters
externalLink
ExcelExternalLink
RemoveAt(int)
Removes the external link at the zero-based index. If the external reference is an workbook any formula links are broken.
public void RemoveAt(int index)
Parameters
index
intThe zero-based index
UpdateCaches()
Updates the value cache for any external workbook in the collection. The link must be an workbook and of type xlsx, xlsm or xlst.
public bool UpdateCaches()