Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+
Row

Workbook.CreateNewDocument() Method

Creates and loads a new empty workbook.

You require a license to the DevExpress Office File API or DevExpress Universal Subscription to use this property in production code.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Docs.v19.1.dll

Declaration

public bool CreateNewDocument()

Returns

Type Description
Boolean

true, if the document is created successfully; otherwise, false.

Remarks

If the WorkbookEventOptions.RaiseOnModificationsViaAPI property is set to true and the document has unsaved changes (the Workbook.Modified property is true), using the CreateNewDocument method will raise the Workbook.DocumentClosing event.

By handling the Workbook.DocumentClosing event, you can set e.Cancel to true to prevent a document from closing. In this case, the CreateNewDocument method will return false.

If the new document was created and successfully loaded, the CreateNewDocument method returns true.

The following code snippets (auto-collected from DevExpress Examples) contain references to the CreateNewDocument() method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

Implements

See Also