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.

C#
public static DocumentFormat.OpenXml.Packaging.SpreadsheetDocument Create (System.IO.Packaging.Package package, DocumentFormat.OpenXml.SpreadsheetDocumentType type);

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

DocumentFormat.OpenXml 3.0.1 and other versions
Product Versions
DocumentFormat.OpenXml 2.7.1, 2.7.2, 2.8.0, 2.8.1, 2.9.0, 2.9.1, 2.10.0, 2.10.1, 2.11.0, 2.11.1, 2.11.2, 2.11.3, 2.12.0, 2.12.1, 2.12.2, 2.12.3, 2.13.0, 2.13.1, 2.14.0, 2.15.0, 2.16.0, 2.17.1, 2.18.0, 2.19.0, 2.20.0, 3.0.0, 3.0.1

Create(Stream, SpreadsheetDocumentType)

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

C#
public static DocumentFormat.OpenXml.Packaging.SpreadsheetDocument Create (System.IO.Stream stream, DocumentFormat.OpenXml.SpreadsheetDocumentType type);

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

DocumentFormat.OpenXml 3.0.1 and other versions
Product Versions
DocumentFormat.OpenXml 2.7.1, 2.7.2, 2.8.0, 2.8.1, 2.9.0, 2.9.1, 2.10.0, 2.10.1, 2.11.0, 2.11.1, 2.11.2, 2.11.3, 2.12.0, 2.12.1, 2.12.2, 2.12.3, 2.13.0, 2.13.1, 2.14.0, 2.15.0, 2.16.0, 2.17.1, 2.18.0, 2.19.0, 2.20.0, 3.0.0, 3.0.1

Create(String, SpreadsheetDocumentType)

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

C#
public static DocumentFormat.OpenXml.Packaging.SpreadsheetDocument Create (string path, DocumentFormat.OpenXml.SpreadsheetDocumentType type);

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

DocumentFormat.OpenXml 3.0.1 and other versions
Product Versions
DocumentFormat.OpenXml 2.7.1, 2.7.2, 2.8.0, 2.8.1, 2.9.0, 2.9.1, 2.10.0, 2.10.1, 2.11.0, 2.11.1, 2.11.2, 2.11.3, 2.12.0, 2.12.1, 2.12.2, 2.12.3, 2.13.0, 2.13.1, 2.14.0, 2.15.0, 2.16.0, 2.17.1, 2.18.0, 2.19.0, 2.20.0, 3.0.0, 3.0.1

Create(Package, SpreadsheetDocumentType, Boolean)

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

C#
public static DocumentFormat.OpenXml.Packaging.SpreadsheetDocument Create (System.IO.Packaging.Package package, DocumentFormat.OpenXml.SpreadsheetDocumentType type, bool autoSave);

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

DocumentFormat.OpenXml 3.0.1 and other versions
Product Versions
DocumentFormat.OpenXml 2.7.1, 2.7.2, 2.8.0, 2.8.1, 2.9.0, 2.9.1, 2.10.0, 2.10.1, 2.11.0, 2.11.1, 2.11.2, 2.11.3, 2.12.0, 2.12.1, 2.12.2, 2.12.3, 2.13.0, 2.13.1, 2.14.0, 2.15.0, 2.16.0, 2.17.1, 2.18.0, 2.19.0, 2.20.0, 3.0.0, 3.0.1

Create(Stream, SpreadsheetDocumentType, Boolean)

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

C#
public static DocumentFormat.OpenXml.Packaging.SpreadsheetDocument Create (System.IO.Stream stream, DocumentFormat.OpenXml.SpreadsheetDocumentType type, bool autoSave);

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

DocumentFormat.OpenXml 3.0.1 and other versions
Product Versions
DocumentFormat.OpenXml 2.7.1, 2.7.2, 2.8.0, 2.8.1, 2.9.0, 2.9.1, 2.10.0, 2.10.1, 2.11.0, 2.11.1, 2.11.2, 2.11.3, 2.12.0, 2.12.1, 2.12.2, 2.12.3, 2.13.0, 2.13.1, 2.14.0, 2.15.0, 2.16.0, 2.17.1, 2.18.0, 2.19.0, 2.20.0, 3.0.0, 3.0.1

Create(String, SpreadsheetDocumentType, Boolean)

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

C#
public static DocumentFormat.OpenXml.Packaging.SpreadsheetDocument Create (string path, DocumentFormat.OpenXml.SpreadsheetDocumentType type, bool autoSave);

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

DocumentFormat.OpenXml 3.0.1 and other versions
Product Versions
DocumentFormat.OpenXml 2.7.1, 2.7.2, 2.8.0, 2.8.1, 2.9.0, 2.9.1, 2.10.0, 2.10.1, 2.11.0, 2.11.1, 2.11.2, 2.11.3, 2.12.0, 2.12.1, 2.12.2, 2.12.3, 2.13.0, 2.13.1, 2.14.0, 2.15.0, 2.16.0, 2.17.1, 2.18.0, 2.19.0, 2.20.0, 3.0.0, 3.0.1