Workbook
Overview
Workbook is a class in Aspose.Cells FOSS for Java.
Inherits from: AutoCloseable.
Represents an Excel workbook.
This class provides 10 methods for working with Workbook objects in Java programs.
Available methods include: Workbook, close, getCalculationProperties, getDefinedNames, getDocumentProperties, getLoadDiagnostics, getProperties, getSettings, getWorksheets, save.
All exported members are accessible to any Java application after installing the Aspose.Cells FOSS for Java package.
Properties: calculationProperties, definedNames, documentProperties, loadDiagnostics, properties, settings, and 1 more.
Description
Workbook is a class in the Aspose.Cells FOSS library for Java that exposes 13 methods and 7 properties for programmatic use. It extends AutoCloseable, inheriting shared functionality from its parent type.
Core capabilities include: worksheetcollection; workbooksettings; workbookproperties. These operations enable developers to integrate workbook functionality directly into Java applications.
The class also provides the worksheets property (returns the worksheets), the settings property (returns the settings), the properties property (returns the properties).
The class offers 5 constructor overloads, allowing flexible initialization depending on the calling context.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
worksheets | WorksheetCollection | Read | Returns the worksheets. |
settings | WorkbookSettings | Read | Returns the settings. |
properties | WorkbookProperties | Read | Returns the properties. |
documentProperties | DocumentProperties | Read | Returns the document properties. |
definedNames | DefinedNameCollection | Read | Returns the defined names. |
loadDiagnostics | LoadDiagnostics | Read | Returns the load diagnostics. |
calculationProperties | CalculationProperties | Read | Returns the workbook calculation properties. |
Methods
| Signature | Description |
|---|---|
Workbook() | Initializes a new Workbook instance. |
Workbook(fileName: String) | Initializes a new Workbook instance. |
Workbook(stream: InputStream) | Initializes a new Workbook instance. |
Workbook(fileName: String, options: LoadOptions) | Initializes a new Workbook instance. |
Workbook(stream: InputStream, options: LoadOptions) | Initializes a new Workbook instance. |
getWorksheets() → WorksheetCollection | Returns the worksheets. |
getSettings() → WorkbookSettings | Returns the settings. |
getProperties() → WorkbookProperties | Returns the properties. |
getDocumentProperties() → DocumentProperties | Returns the document properties. |
getDefinedNames() → DefinedNameCollection | Returns the defined names. |
getLoadDiagnostics() → LoadDiagnostics | Returns the load diagnostics. |
getCalculationProperties() → CalculationProperties | Returns the workbook calculation properties. |
save(fileName: String) | Saves the workbook to a file path (XLSX format). |
save(fileName: String, format: SaveFormat) | Saves the workbook to a file path with the given format. |
save(fileName: String, options: SaveOptions) | Saves the workbook to a file path with the given options. |
save(stream: OutputStream, format: SaveFormat) | Saves the workbook to a stream with the given format. |
save(stream: OutputStream, options: SaveOptions) | Saves the workbook to a stream with the given options. |
close() | Releases any resources associated with this instance. |