SpreadsheetDocument.Create Method (String, SpreadsheetDocumentType, Boolean)
Creates a new instance of the SpreadsheetDocument class from the specified file.
Namespace: DocumentFormat.OpenXml.Packaging
Assembly: DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)
Syntax
'Declaration
Public Shared Function Create ( _
path As String, _
type As SpreadsheetDocumentType, _
autoSave As Boolean _
) As SpreadsheetDocument
'Usage
Dim path As String
Dim type As SpreadsheetDocumentType
Dim autoSave As Boolean
Dim returnValue As SpreadsheetDocument
returnValue = SpreadsheetDocument.Create(path, type, _
autoSave)
public static SpreadsheetDocument Create(
string path,
SpreadsheetDocumentType type,
bool autoSave
)
Parameters
- path
Type: System.String
The path and file name of the target SpreadsheetDocument.
- type
Type: DocumentFormat.OpenXml.SpreadsheetDocumentType
The type of the SpreadsheetDocument.
- autoSave
Type: System.Boolean
Whether to auto save the created document.
Return Value
Type: DocumentFormat.OpenXml.Packaging.SpreadsheetDocument
A new instance of SpreadsheetDocument.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | Thrown when "path" is null reference. |