Workbook
Overview
Workbook is a class in Aspose.Cells for NET.
Inherits from: IDisposable.
Workbook.Workbook() creates a new empty workbook instance.
Description
Workbook is a class in the Aspose.Cells FOSS library for .NET that exposes 6 methods and 6 properties for programmatic use. It extends IDisposable, inheriting shared functionality from its parent type.
The class also provides the Worksheets property (property gets the collection of worksheets in the workbook), the Settings property (property gets workbook-level settings such as calculation mode), the Properties property (property gets core workbook properties like author and title).
The class offers 5 constructor overloads, allowing flexible initialization depending on the calling context.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
Worksheets | WorksheetCollection | Read | Property gets the collection of worksheets in the workbook |
Settings | WorkbookSettings | Read | Property gets workbook-level settings such as calculation mode |
Properties | WorkbookProperties | Read | Property gets core workbook properties like author and title |
DocumentProperties | DocumentProperties | Read | Property gets extended document properties of the workbook |
DefinedNames | DefinedNameCollection | Read | Property gets the collection of defined names (named ranges) in the workbook |
LoadDiagnostics | LoadDiagnostics | Read | Property gets diagnostics information from the last load operation |
Methods
| Signature | Description |
|---|---|
Workbook() | Creates a new empty workbook instance |
Workbook(fileName: string) | Opens an existing workbook from the specified file path |
Workbook(stream: Stream) | Opens a workbook from the given stream using auto-detected format |
Workbook(fileName: string, options: LoadOptions) | Opens an existing workbook from the file path with the specified load options |
Workbook(stream: Stream, options: LoadOptions) | Opens a workbook from the given stream with the specified load options |
Save(fileName: string) | Saves the workbook to the specified file path in default format |
Save(fileName: string, format: SaveFormat) | Saves the workbook to the file path in the specified SaveFormat |
Save(fileName: string, options: SaveOptions) | Saves the workbook to the file path using the specified save options |
Save(stream: Stream, format: SaveFormat) | Saves the workbook to the given stream in the specified SaveFormat |
Save(stream: Stream, options: SaveOptions) | Saves the workbook to the given stream using the specified save options |
Dispose() | Releases resources used by the workbook |