Workbook

Overview

Workbook is a class in Aspose.Cells FOSS for C++.

Represents the root spreadsheet object used to create, load, modify, and save an XLSX workbook.

This class provides 26 methods for working with Workbook objects in C++ programs. Available methods include: Dispose, EnsureUniqueDefinedName, EnsureUniqueSheetName, EnsureValidDefinedNameScope, GetDefinedNames, GetDefinedNamesModel, GetDocumentProperties, GetLoadDiagnostics, GetModel, GetProperties, GetSettings, GetWorksheets, and 2 additional methods. All public members are accessible to any C++ application after installing the Aspose.Cells FOSS for C++ package. Accessor methods: Workbook.

Accessor Methods

NameTypeAccessDescription
WorkbookWorkbookReadGets the workbook.

Methods

SignatureDescription
Workbook()WorkbookCalls Workbook on this Workbook instance.
Workbook()
GetWorksheets()WorksheetCollectionGets the worksheets in workbook order.
GetWorksheets()WorksheetCollectionReturns the worksheets.
GetSettings()WorkbookSettingsGets workbook-level settings such as the date system and display culture.
GetSettings()WorkbookSettingsReturns the settings.
GetProperties()WorkbookPropertiesGets workbook metadata and view settings exposed by the supported public API.
GetProperties()WorkbookPropertiesReturns the properties.
GetDocumentProperties()DocumentPropertiesGets the document properties facade for core and extended metadata.
GetDocumentProperties()DocumentPropertiesReturns the document properties.
GetDefinedNames()DefinedNameCollectionGets the workbook-defined names collection.
GetDefinedNames()DefinedNameCollectionReturns the defined names.
GetLoadDiagnostics()LoadDiagnosticsGets diagnostics collected while loading the current workbook.
GetLoadDiagnostics()LoadDiagnosticsReturns the load diagnostics.
Save(fileName: std::string_view)Saves the workbook to an XLSX file using default save options.
Save(fileName: std::string_view, format: SaveFormat)Saves the workbook to a file using the specified save format.
Save(fileName: std::string_view, options: SaveOptions)Saves the workbook to a file using explicit save options.
Save(stream: std::vector<std::uint8_t>, format: SaveFormat)Saves the workbook to a stream using the specified save format.
Save(stream: std::vector<std::uint8_t>, options: SaveOptions)Saves the workbook to a stream using explicit save options.
GetModel()Core::WorkbookModelGets the underlying workbook model.
GetModel()Core::WorkbookModelReturns the model.
GetDefinedNamesModel()std::vector<Core::DefinedNameModel>Gets the underlying defined names model vector.
EnsureUniqueSheetName(sheetName: std::string_view, currentSheet: std::optional<std::reference_wrapper<const Core::WorksheetModel>>)Ensures no other worksheet in the workbook shares the given name. Throws CellsException when a duplicate is found.
EnsureValidDefinedNameScope(localSheetIndex: std::optional<int>)Validates that the local sheet index is absent (global scope) or within the valid worksheet range. Throws CellsException otherwise.
EnsureUniqueDefinedName(currentDefinedName: Core::DefinedNameModel, name: std::string_view, localSheetIndex: std::optional<int>)Ensures no other defined name in the workbook shares the given name and scope. Throws CellsException when a duplicate is found.
Dispose()Releases resources associated with the workbook instance.

See Also

 English