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

NameTypeAccessDescription
worksheetsWorksheetCollectionReadReturns the worksheets.
settingsWorkbookSettingsReadReturns the settings.
propertiesWorkbookPropertiesReadReturns the properties.
documentPropertiesDocumentPropertiesReadReturns the document properties.
definedNamesDefinedNameCollectionReadReturns the defined names.
loadDiagnosticsLoadDiagnosticsReadReturns the load diagnostics.
calculationPropertiesCalculationPropertiesReadReturns the workbook calculation properties.

Methods

SignatureDescription
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()WorksheetCollectionReturns the worksheets.
getSettings()WorkbookSettingsReturns the settings.
getProperties()WorkbookPropertiesReturns the properties.
getDocumentProperties()DocumentPropertiesReturns the document properties.
getDefinedNames()DefinedNameCollectionReturns the defined names.
getLoadDiagnostics()LoadDiagnosticsReturns the load diagnostics.
getCalculationProperties()CalculationPropertiesReturns 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.

See Also

 English