Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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)

public static SpreadsheetDocument Open(
	Package package
)

Parameters

package
Type: System.IO.Packaging.Package
Specifies the OpenXml package.

Return Value

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

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

Show: