Show / Hide Table of Contents

Class ExcelExternalLinksCollection

A collection of external links referenced by the workbook.

Inheritance
object
ExcelExternalLinksCollection
Implements
IEnumerable<ExcelExternalLink>
IEnumerable
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: OfficeOpenXml.ExternalReferences
Assembly: EPPlus.dll
Syntax
public class ExcelExternalLinksCollection : IEnumerable<ExcelExternalLink>, IEnumerable

Properties

Count

Gets the number of items in the collection

Declaration
public int Count { get; }
Property Value
Type Description
int

Directories

A list of directories to look for the external files that cannot be found on the path of the uri.

Declaration
public List<DirectoryInfo> Directories { get; }
Property Value
Type Description
List<DirectoryInfo>

this[int]

The indexer for the collection

Declaration
public ExcelExternalLink this[int index] { get; }
Parameters
Type Name Description
int index

The index

Property Value
Type Description
ExcelExternalLink

Methods

AddExternalWorkbook(FileInfo)

Adds an external reference to another workbook.

Declaration
public ExcelExternalWorkbook AddExternalWorkbook(FileInfo file)
Parameters
Type Name Description
FileInfo file

The location of the external workbook. The external workbook must of type .xlsx, .xlsm or xlst

Returns
Type Description
ExcelExternalWorkbook

The ExcelExternalWorkbook object

Clear()

Clear all external links and break any formula links.

Declaration
public void Clear()

GetEnumerator()

Returns an enumerator that iterates through the collection.

Declaration
public IEnumerator<ExcelExternalLink> GetEnumerator()
Returns
Type Description
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.

Declaration
public bool LoadWorkbooks()
Returns
Type Description
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.

Declaration
public void Remove(ExcelExternalLink externalLink)
Parameters
Type Name Description
ExcelExternalLink externalLink

RemoveAt(int)

Removes the external link at the zero-based index. If the external reference is an workbook any formula links are broken.

Declaration
public void RemoveAt(int index)
Parameters
Type Name Description
int index

The 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.

Declaration
public bool UpdateCaches()
Returns
Type Description
bool

True if all updates succeeded, otherwise false. Any errors can be found on the External links. ErrorLog

Implements

IEnumerable<T>
IEnumerable
In this article
Back to top Generated by DocFX