The workbook consists of a set of worksheets. In addition, the workbook contains a list of named ranges, manages undo/redo and provides formula calculations.
The workbooks are represented by the Workbook class. The worksheets in the workbook can be accessed and managed through the Worksheets collection of the Workbook class. New worksheets are created and added to the workbook indirectly, through the add method of this collection. The NamedRange objects of the workbook are managed through the NamedRanges collection.
The workbook acts as a model and do not provide visualization directly. To display a workbook on a form, use the WorkbookView control. To print or preview a workbook, use the print method of the Workbook class. For more information about this, see Views.
Workbooks can be imported from and exported to a variety of formats. To import a workbook, use the appropriate importer class – CsvImporter, CalcImporter, ExcelImporter, and so on. Alternatively, to export a workbook, use an instance of the one of the exporter classes - PdfExporter, ImageExporter, CsvExporter, and so on. The workbook can be serialized to and deserialized from a file through the saveToXml and loadFromXml overloads. To read more about serialization, check the Serialization and Output topic.
The Workbook class provides automatic undo and redo of changes. The undo and redo can be enabled and disabled through the UndoEnabled property. To undo or redo an action, use the undo and redo methods. To check if there is an action to be undone or redone, use the CanUndo and CanRedo properties. When an action is undone or redone, the actionUndone or actionRedone events are raised. For more information about this, check the Undo and Redo topic.
To specify the culture of the workbook and its associated worksheets, use the Locale property. This culture is used when parsing and formatting data in the worksheets. The default of this property is the culture of the current thread.