Back to Devexpress

How to: Create a New Workbook

wpf-117094-controls-and-libraries-spreadsheet-examples-workbooks-how-to-create-a-new-workbook.md

latest1.4 KB
Original Source

How to: Create a New Workbook

  • Jun 07, 2019

By default, when you create a SpreadsheetControl instance, it contains a workbook with one empty worksheet (“Sheet1”). The same workbook is also created when you call the control’s SpreadsheetControl.CreateNewDocument method or the CreateNewDocument method of the IWorkbook object.

The SpreadsheetControl.EmptyDocumentCreated event occurs after a new document is created.

csharp
spreadsheetControl1.CreateNewDocument();
vb
spreadsheetControl1.CreateNewDocument()

To load an existing document into a SpreadsheetControl, use the SpreadsheetControl.LoadDocument or IWorkbook.LoadDocument method. To save a workbook after all modifications are complete, use the SpreadsheetControl.SaveDocument or IWorkbook.SaveDocument method.