Class ExcelExternalLinksCollection
Inheritance
Inherited Members
Namespace: OfficeOpenXml.ExternalReferences
Assembly: EPPlus.dll
Syntax
public class ExcelExternalLinksCollection : IEnumerable<ExcelExternalLink>, IEnumerable
Properties
Count
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Directories
A list of directories to look for the external files that can not be found on the path of the uri.
Declaration
public List<DirectoryInfo> Directories { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<System.IO.DirectoryInfo> |
Item[Int32]
Declaration
public ExcelExternalLink this[int index] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | 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 |
---|---|---|
System.IO.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()
Declaration
public IEnumerator<ExcelExternalLink> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<ExcelExternalLink> |
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 |
---|---|
System.Boolean | 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(Int32)
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 |
---|---|---|
System.Int32 | 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 |
---|---|
System.Boolean | True if all updates succeeded, otherwise false. Any errors can be found on the External links. ErrorLog |
Explicit Interface Implementations
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |