- 2 min to read
A workbook is a document in the ASPxSpreadsheet control. It is an object that exposes the IWorkbook interface. The IWorkbook interface provides a comprehensive set of properties and methods required to manipulate the corresponding workbook. To access a workbook that is currently loaded in the ASPxSpreadsheet control, use the ASPxSpreadsheet.Document property. This is the starting point for using the ASPxSpreadsheet API.
By default, when you create an ASPxSpreadsheet instance, it contains a workbook with one empty worksheet ("Sheet1"). The same workbook is also created when you call the IWorkbook.CreateNewDocument method. To load an existing document into the ASPxSpreadsheet control, use the IWorkbook.LoadDocument method. To save a workbook after all modifications are complete, use the IWorkbook.SaveDocument method. The Supported Formats topic lists the file formats supported for loading and saving workbooks.
A workbook contains a collection of styles, which can be used to format cell appearance in any worksheet. To access and modify this collection (for example, add a new style or modify an existing style), use the IWorkbook.Styles property.
You can also specify other workbook options using the corresponding properties of an object returned by IWorkbook.Options.
- DocumentOptions.Export, DocumentOptions.Import - Specify parameters required to import workbooks from or export workbooks to different file formats.
- DocumentOptions.DocumentCapabilities - Sets document restrictions.
- DocumentOptions.Save - Defines the file name and file format to be used when saving a workbook.