Show / Hide Table of Contents

Class ExcelExternalWorkbook

Represents an external workbook.

Inheritance
System.Object
ExcelExternalLink
ExcelExternalWorkbook
Inherited Members
ExcelExternalLink.As
ExcelExternalLink.Index
ExcelExternalLink.ErrorLog
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: OfficeOpenXml.ExternalReferences
Assembly: EPPlus.dll
Syntax
public class ExcelExternalWorkbook : ExcelExternalLink

Properties

CachedNames

A collection of cached defined names in the external workbook

Declaration
public ExcelExternalNamedItemCollection<ExcelExternalDefinedName> CachedNames { get; }
Property Value
Type Description
ExcelExternalNamedItemCollection<ExcelExternalDefinedName>

CachedWorksheets

A collection of cached worksheets in the external workbook

Declaration
public ExcelExternalNamedItemCollection<ExcelExternalWorksheet> CachedWorksheets { get; }
Property Value
Type Description
ExcelExternalNamedItemCollection<ExcelExternalWorksheet>

CacheStatus

The status of the cache. If the UpdateCache()method fails this status is set to Failed If cache status is set to NotUpdated, the cache will be updated when the package is saved. UpdateCache() ErrorLog

Declaration
public eExternalWorkbookCacheStatus CacheStatus { get; }
Property Value
Type Description
eExternalWorkbookCacheStatus

ExternalLinkType

Sets the external link type

Declaration
public override eExternalLinkType ExternalLinkType { get; }
Property Value
Type Description
eExternalLinkType
Overrides
ExcelExternalLink.ExternalLinkType

ExternalLinkUri

The Uri to the external workbook. This property will be set by the File property on save, if it has been set.

Declaration
public Uri ExternalLinkUri { get; set; }
Property Value
Type Description
System.Uri

File

If the external reference is a file in the filesystem

Declaration
public FileInfo File { get; set; }
Property Value
Type Description
System.IO.FileInfo

IsPathRelative

If true, sets the path to the workbook as a relative path on Load(), if the link is on the same drive. Otherwise set it as an absolute path. If set to false, the path will always be saved as an absolute path. If the file path is relative and the file can not be found, the file path will not be updated. Load() File

Declaration
public bool IsPathRelative { get; set; }
Property Value
Type Description
System.Boolean

Package

A reference to the external package, it it has been loaded. Load()

Declaration
public ExcelPackage Package { get; }
Property Value
Type Description
ExcelPackage

Methods

Load()

Tries to Loads the external package using the External Uri into the Package property

Declaration
public bool Load()
Returns
Type Description
System.Boolean

True if the load succeeded, otherwise false. If false, see ErrorLog

Load(ExcelPackage)

Tries to Loads the external package using the External Uri into the Package property

Declaration
public bool Load(ExcelPackage package)
Parameters
Type Name Description
ExcelPackage package
Returns
Type Description
System.Boolean

True if the load succeeded, otherwise false. If false, see ErrorLog and CacheStatus of each ExcelExternalWorkbook

Load(FileInfo)

Tries to Loads the external package using the External Uri into the Package property

Declaration
public bool Load(FileInfo packageFile)
Parameters
Type Name Description
System.IO.FileInfo packageFile
Returns
Type Description
System.Boolean

True if the load succeeded, otherwise false. If false, see ErrorLog

ToString()

String representation

Declaration
public override string ToString()
Returns
Type Description
System.String
Overrides
ExcelExternalLink.ToString()

UpdateCache()

Updates the external reference cache for the external workbook. To be used a Package must be loaded via the Load() method. CacheStatus ErrorLog

Declaration
public bool UpdateCache()
Returns
Type Description
System.Boolean

True if the update was successful otherwise false

In This Article
Back to top Generated by DocFX