다음을 통해 공유


SpreadsheetDocument.Open Method

Definition

Overloads

Open(String, Boolean, OpenSettings)

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

Open(Stream, Boolean, OpenSettings)

Creates a new instance of the SpreadsheetDocument class from the IO stream.

Open(String, Boolean)

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

Open(Package, OpenSettings)

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

Open(Package)

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

Open(Stream, Boolean)

Creates a new instance of the SpreadsheetDocument class from the IO stream.

Open(String, Boolean, OpenSettings)

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

public static DocumentFormat.OpenXml.Packaging.SpreadsheetDocument Open (string path, bool isEditable, DocumentFormat.OpenXml.Packaging.OpenSettings openSettings);
static member Open : string * bool * DocumentFormat.OpenXml.Packaging.OpenSettings -> DocumentFormat.OpenXml.Packaging.SpreadsheetDocument
Public Shared Function Open (path As String, isEditable As Boolean, openSettings As OpenSettings) As SpreadsheetDocument

Parameters

path
String

The path and file name of the target SpreadsheetDocument.

isEditable
Boolean

In ReadWrite mode. False for Read only mode.

openSettings
OpenSettings

The advanced settings for opening a document.

Returns

A new instance of SpreadsheetDocument.

Exceptions

Thrown when "path" is null reference.

Thrown when the package is not valid Open XML SpreadsheetDocument.

Thrown when specified to process the markup compatibility but the given target FileFormatVersion is incorrect.

Applies to

Open(Stream, Boolean, OpenSettings)

Creates a new instance of the SpreadsheetDocument class from the IO stream.

public static DocumentFormat.OpenXml.Packaging.SpreadsheetDocument Open (System.IO.Stream stream, bool isEditable, DocumentFormat.OpenXml.Packaging.OpenSettings openSettings);
static member Open : System.IO.Stream * bool * DocumentFormat.OpenXml.Packaging.OpenSettings -> DocumentFormat.OpenXml.Packaging.SpreadsheetDocument
Public Shared Function Open (stream As Stream, isEditable As Boolean, openSettings As OpenSettings) As SpreadsheetDocument

Parameters

stream
Stream

The IO stream on which to open the SpreadsheetDocument.

isEditable
Boolean

In ReadWrite mode. False for Read only mode.

openSettings
OpenSettings

The advanced settings for opening a document.

Returns

A new instance of SpreadsheetDocument.

Exceptions

Thrown when "stream" is null reference.

Thrown when "stream" is not opened with Read (ReadWrite) access.

Thrown when the package is not valid Open XML SpreadsheetDocument.

Thrown when specified to process the markup compatibility but the given target FileFormatVersion is incorrect.

Applies to

Open(String, Boolean)

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

public static DocumentFormat.OpenXml.Packaging.SpreadsheetDocument Open (string path, bool isEditable);
static member Open : string * bool -> DocumentFormat.OpenXml.Packaging.SpreadsheetDocument
Public Shared Function Open (path As String, isEditable As Boolean) As SpreadsheetDocument

Parameters

path
String

The path and file name of the target SpreadsheetDocument.

isEditable
Boolean

In ReadWrite mode. False for Read only mode.

Returns

A new instance of SpreadsheetDocument.

Exceptions

Thrown when "path" is null reference.

Thrown when the package is not valid Open XML SpreadsheetDocument.

Applies to

Open(Package, OpenSettings)

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

public static DocumentFormat.OpenXml.Packaging.SpreadsheetDocument Open (System.IO.Packaging.Package package, DocumentFormat.OpenXml.Packaging.OpenSettings openSettings);
static member Open : System.IO.Packaging.Package * DocumentFormat.OpenXml.Packaging.OpenSettings -> DocumentFormat.OpenXml.Packaging.SpreadsheetDocument
Public Shared Function Open (package As Package, openSettings As OpenSettings) As SpreadsheetDocument

Parameters

package
Package

The specified OpenXml package.

openSettings
OpenSettings

The advanced settings for opening a document.

Returns

A new instance of SpreadsheetDocument.

Exceptions

Thrown when "package" is not opened with Read (ReadWrite) access.

Thrown when package is a null reference.

Thrown when the package is not a valid Open XML document.

Thrown when specified to process the markup compatibility but the given target FileFormatVersion is incorrect.

Applies to

Open(Package)

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

public static DocumentFormat.OpenXml.Packaging.SpreadsheetDocument Open (System.IO.Packaging.Package package);
static member Open : System.IO.Packaging.Package -> DocumentFormat.OpenXml.Packaging.SpreadsheetDocument
Public Shared Function Open (package As Package) As SpreadsheetDocument

Parameters

package
Package

The specified OpenXml package.

Returns

A new instance of SpreadsheetDocument.

Exceptions

Thrown when "package" is null reference.

Thrown when "package" is not opened with Read (ReadWrite) access.

Thrown when the package is not valid Open XML SpreadsheetDocument.

Applies to

Open(Stream, Boolean)

Creates a new instance of the SpreadsheetDocument class from the IO stream.

public static DocumentFormat.OpenXml.Packaging.SpreadsheetDocument Open (System.IO.Stream stream, bool isEditable);
static member Open : System.IO.Stream * bool -> DocumentFormat.OpenXml.Packaging.SpreadsheetDocument
Public Shared Function Open (stream As Stream, isEditable As Boolean) As SpreadsheetDocument

Parameters

stream
Stream

The IO stream on which to open the SpreadsheetDocument.

isEditable
Boolean

In ReadWrite mode. False for Read only mode.

Returns

A new instance of SpreadsheetDocument.

Exceptions

Thrown when "stream" is null reference.

Thrown when "stream" is not opened with Read (ReadWrite) access.

Thrown when the package is not valid Open XML SpreadsheetDocument.

Applies to