SpreadsheetDocument.Open Method (Package)

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Creates a new instance of the SpreadsheetDocument class from the specified package.

Namespace:  DocumentFormat.OpenXml.Packaging
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

Syntax

'Declaration
Public Shared Function Open ( _
    package As Package _
) As SpreadsheetDocument
'Usage
Dim package As Package
Dim returnValue As SpreadsheetDocument

returnValue = SpreadsheetDocument.Open(package)
public static SpreadsheetDocument Open(
    Package package
)

Parameters

Return Value

Type: DocumentFormat.OpenXml.Packaging.SpreadsheetDocument
Returns a new instance of SpreadsheetDocument.

Exceptions

Exception Condition
ArgumentNullException

Throws an exception when package is null reference.

IOException

Throws an exception when package is not opened with Read (ReadWrite) access.

OpenXmlPackageException

Throws an exception when the package is not valid Open XML SpreadsheetDocument.

See Also

Reference

SpreadsheetDocument Class

SpreadsheetDocument Members

Open Overload

DocumentFormat.OpenXml.Packaging Namespace