SpreadsheetDocument.Create Method

Definition

Overloads

Create(Package, SpreadsheetDocumentType)

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

Create(Stream, SpreadsheetDocumentType)

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

Create(String, SpreadsheetDocumentType)

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

Create(Package, SpreadsheetDocumentType, Boolean)

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

Create(Stream, SpreadsheetDocumentType, Boolean)

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

Create(String, SpreadsheetDocumentType, Boolean)

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

Create(Package, SpreadsheetDocumentType)

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

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

Parameters

package
Package

The specified OpenXml package.

type
SpreadsheetDocumentType

The type of the SpreadsheetDocument.

Returns

A new instance of SpreadsheetDocument.

Exceptions

Thrown when "package" is null reference.

Thrown when "package" is not opened with Write access.

Applies to

Create(Stream, SpreadsheetDocumentType)

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

public static DocumentFormat.OpenXml.Packaging.SpreadsheetDocument Create (System.IO.Stream stream, DocumentFormat.OpenXml.SpreadsheetDocumentType type);
static member Create : System.IO.Stream * DocumentFormat.OpenXml.SpreadsheetDocumentType -> DocumentFormat.OpenXml.Packaging.SpreadsheetDocument
Public Shared Function Create (stream As Stream, type As SpreadsheetDocumentType) As SpreadsheetDocument

Parameters

stream
Stream

The IO stream on which to create the SpreadsheetDocument.

type
SpreadsheetDocumentType

The type of the SpreadsheetDocument.

Returns

A new instance of SpreadsheetDocument.

Exceptions

Thrown when "stream" is null reference.

Thrown when "stream" is not opened with Write access.

Applies to

Create(String, SpreadsheetDocumentType)

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

public static DocumentFormat.OpenXml.Packaging.SpreadsheetDocument Create (string path, DocumentFormat.OpenXml.SpreadsheetDocumentType type);
static member Create : string * DocumentFormat.OpenXml.SpreadsheetDocumentType -> DocumentFormat.OpenXml.Packaging.SpreadsheetDocument
Public Shared Function Create (path As String, type As SpreadsheetDocumentType) As SpreadsheetDocument

Parameters

path
String

The path and file name of the target SpreadsheetDocument.

type
SpreadsheetDocumentType

The type of the SpreadsheetDocument.

Returns

A new instance of SpreadsheetDocument.

Exceptions

Thrown when "path" is null reference.

Applies to

Create(Package, SpreadsheetDocumentType, Boolean)

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

public static DocumentFormat.OpenXml.Packaging.SpreadsheetDocument Create (System.IO.Packaging.Package package, DocumentFormat.OpenXml.SpreadsheetDocumentType type, bool autoSave);
static member Create : System.IO.Packaging.Package * DocumentFormat.OpenXml.SpreadsheetDocumentType * bool -> DocumentFormat.OpenXml.Packaging.SpreadsheetDocument
Public Shared Function Create (package As Package, type As SpreadsheetDocumentType, autoSave As Boolean) As SpreadsheetDocument

Parameters

package
Package

The specified OpenXml package.

type
SpreadsheetDocumentType

The type of the SpreadsheetDocument.

autoSave
Boolean

Whether to auto save the created document.

Returns

A new instance of SpreadsheetDocument.

Exceptions

Thrown when "package" is null reference.

Thrown when "package" is not opened with Write access.

Applies to

Create(Stream, SpreadsheetDocumentType, Boolean)

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

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

Parameters

stream
Stream

The IO stream on which to create the SpreadsheetDocument.

type
SpreadsheetDocumentType

The type of the SpreadsheetDocument.

autoSave
Boolean

Whether to auto save the created document.

Returns

A new instance of SpreadsheetDocument.

Exceptions

Thrown when "stream" is null reference.

Thrown when "stream" is not opened with Write access.

Applies to

Create(String, SpreadsheetDocumentType, Boolean)

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

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

Parameters

path
String

The path and file name of the target SpreadsheetDocument.

type
SpreadsheetDocumentType

The type of the SpreadsheetDocument.

autoSave
Boolean

Whether to auto save the created document.

Returns

A new instance of SpreadsheetDocument.

Exceptions

Thrown when "path" is null reference.

Applies to