Skip to main content
A newer version of this page is available. .

How to: Create a New Workbook

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.

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