Aspose.Cells FOSS for C++ is an open-source library that enables developers to programmatically
create, load, edit, and save Excel .xlsx workbooks without requiring Microsoft Excel or any
COM interop. The library provides a native C++ API that integrates directly into CMake-based
build systems with no external runtime dependencies.
The core API covers Workbook creation and persistence, Worksheet and cell manipulation via
Worksheet.GetCells(), cell value assignment using Cell.PutValue(), formula entry with
Cell.SetFormula(), and rich styling through the Style, Font, and Color classes. Number
format display is handled by DisplayTextFormatter with full locale support. Named ranges are
managed through DefinedNameUtility and related collection classes.
Aspose.Cells FOSS for C++ is released under the MIT license with no runtime fees or usage restrictions. Build from source using CMake and integrate directly into your project as a header-and-source library. To work with Excel spreadsheets in C++ production applications — including formula evaluation, chart rendering, and pivot tables — see the Aspose.Cells — Enterprise Product Family.
Workbook instances or load existing .xlsx filesWorksheetCollectionWorksheet.SetName()Worksheet.GetCells()Workbook.Save()Cell.PutValue()Cell.SetFormula()DisplayTextFormatterStyle.SetNumber()ParsedNumericFormatCell.GetStyle() and Cell.SetStyle()Style.SetFont() with Font.SetBold() and Font.SetColor()Style.SetPattern() and Style.SetForegroundColor()Color.FromArgb()PageSetupPageSetup methodsCreate a workbook, populate cells with values and a formula, apply header styling, and save:
#include "aspose/cells_foss/Workbook.h"
#include "aspose/cells_foss/Worksheet.h"
#include "aspose/cells_foss/Cell.h"
#include "aspose/cells_foss/Style.h"
#include "aspose/cells_foss/Color.h"
#include "aspose/cells_foss/Font.h"
using namespace Aspose::Cells_FOSS;
int main() {
Workbook workbook;
Worksheet& sheet = workbook.GetWorksheets()[0];
sheet.SetName("Products");
sheet.GetCells()["A1"].PutValue("Product");
sheet.GetCells()["B1"].PutValue("Price");
sheet.GetCells()["A2"].PutValue("Apple");
sheet.GetCells()["B2"].PutValue(2.99);
sheet.GetCells()["B4"].SetFormula("=SUM(B2:B3)");
Style headerStyle = sheet.GetCells()["A1"].GetStyle();
Font font;
font.SetBold(true);
font.SetColor(Color::FromArgb(255, 255, 255, 255));
headerStyle.SetFont(font);
headerStyle.SetForegroundColor(Color::FromArgb(255, 34, 120, 212));
sheet.GetCells()["A1"].SetStyle(headerStyle);
workbook.Save("products.xlsx");
return 0;
}
MIT License � free for commercial and open-source use. Include the LICENSE.txt file when distributing.
XLSX for both load and save. CSV load is supported; CSV save is not available in v0.1.
Clone the repository and use CMake add_subdirectory or FetchContent. Requires a C++17 compiler and CMake 3.15+. No external dependencies.
No. Aspose.Cells FOSS for C++ is fully self-contained and does not require Microsoft Excel or any COM interop.
Several classes in v0.1 are declared but stub-only, including ConditionalFormattingCollection and AutoFilter. Core Workbook, Worksheet, Cell, and Style operations are fully functional.