Back to Devexpress

ISpreadsheetComponent.CreateNewDocument() Method

officefileapi-devexpress-dot-spreadsheet-dot-ispreadsheetcomponent.md

latest2.0 KB
Original Source

ISpreadsheetComponent.CreateNewDocument() Method

Creates and loads a new empty workbook.

Namespace : DevExpress.Spreadsheet

Assembly : DevExpress.Spreadsheet.v25.2.Core.dll

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
bool CreateNewDocument()
vb
Function CreateNewDocument As Boolean

Returns

TypeDescription
Boolean

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

|

Remarks

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

By handling the ISpreadsheetComponent.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.

See Also

ISpreadsheetComponent Interface

ISpreadsheetComponent Members

DevExpress.Spreadsheet Namespace