Back to Devexpress

How to: Create a New Workbook

windowsforms-15352-controls-and-libraries-spreadsheet-examples-workbooks-how-to-create-a-new-workbook.md

latest2.0 KB
Original Source

How to: Create a New Workbook

  • Apr 22, 2022

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 ISpreadsheetComponent.CreateNewDocument method of the IWorkbook object.

The SpreadsheetControl.EmptyDocumentCreated event is raised 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. See the How to: Load a Document into SpreadsheetControl and How to: Save a Document to a File examples.

See Also

Workbook