1. Products
  2.   Spreadsheet
  3.   C++
  4.   XlsxReaderWriter
 
  

Free C API to Create, Read & Manage Excel XLSX Worksheet

Leading Open Source C XLSX Library allows Software Developers to Read, Write, Merge, Edit, and Manipulate .xlsx Spreadsheet. It allows to Manage Multiple Worksheets, Cell Formatting, Merge and Unmerge & So on.

What is XlsxReaderWriter?

In today’s data-driven world, Excel XLSX files are essential for storing, analyzing, and reporting information. For developers working in C or C++, managing these files efficiently requires a reliable and straightforward solution. XlsxReaderWriter, a lightweight C XLSX library, simplifies the complexities of handling Office Open XML (OOXML) formats by providing an intuitive interface for reading and writing .xlsx files. Developers can use this C++ XLSX API to create Excel spreadsheets, extract data, and automate spreadsheet-related tasks—all without relying on Microsoft Excel or heavy third-party software. This makes it an ideal choice for building custom applications that need to interact with Excel files for seamless data management and automation.

Ideal for macOS and iOS development, XlsxReaderWriter enables developers to generate XLSX spreadsheets, format cells and rows, embed images, manage formulas, merge cells, and add new worksheets or hyperlinks—offering full control over spreadsheet customization. Whether you're building enterprise apps or lightweight embedded systems, this C++ XLSX library is designed to be portable, dependency-free, and high-performing. Developers can easily convert XLSX files or render XLSX Excel files into user-friendly formats, supporting features needed in modern applications that demand spreadsheet functionality. With its simplicity and power, XlsxReaderWriter is a perfect tool for integrating robust Excel capabilities into C/C++ projects.

Previous Next

Getting Started with XlsxReaderWriter

XlsxReaderWriter supports CMake for building and installing the library. Start by cloning the GitHub repository to your local machine

Install XlsxReaderWriter via CRAN

 cmake $SOURCE_DIR $FLAGS 

Clone the XlsxReaderWriter source code repository from GitHub. Please use the following code.

Clone the XlsxReaderWriter source code repository from GitHub. Please use the following code.

Git clone https://github.com/jmcnamara/libxlsxwriter.git 

Navigate to the repository directory and build the library using the provided Makefile:

cd XlsxReaderWriter
make

Read and Write Excel XLSX File via C

The open source XlsxReaderWriter library allows users to both read and write .xlsx files, making it a versatile solution for handling spreadsheet data. Software developers can load and read an existing spreadsheet with just couple of lines of code. It is also very easy to create and add new sheets, modify existing sheets, format cells, rows and columns, add new rows and columns, insert images and so on. The following example demonstrates, how software developers can create an XLSX spreadsheets documents using C commands.

How to Create New XLSX Spreadsheets inside C Apps?

#import "XlsxReaderWriter.h"

- (void)createXlsxFile {
    BRAOfficeDocumentPackage *spreadsheet = [[BRAOfficeDocumentPackage alloc] init];
    BRAWorksheet *worksheet = [spreadsheet.workbook createWorksheetNamed:@"Sheet1"];
    
    [[worksheet cellForCellReference:@"A1"] setStringValue:@"Hello, XlsxReaderWriter!"];
    
    [spreadsheet saveAs:@"/path/to/output.xlsx"];
}

Create and Manage Multiple Sheets via C Library

The XlsxReaderWriter library has provided complete support for working with multiple worksheets within a single Excel file inside C applications. With just a couple of lines of code software developers can create, read, delete, split/merge or modify sheets as needed. Here is a simple example that demonstrates how software developers can create multiple sheets inside a worksheet using C commands.

How to Create Multiple Sheets using C Library?

BRAOfficeDocumentPackage *spreadsheet = [[BRAOfficeDocumentPackage alloc] init];
[spreadsheet.workbook createWorksheetNamed:@"DataSheet"];
[spreadsheet.workbook createWorksheetNamed:@"Summary"];
[spreadsheet saveAs:@"/path/to/multi-sheet.xlsx"];

Merging and Unmerging Cells via C Library

The open source XlsxReaderWriter library has provided complete support for loading and manipulating Spreadsheet Cells inside C applications. The library makes it for software developers to merge and unmerge Excel worksheet cells, which is useful for creating structured layouts. Here is a simple example that shows how software developers can merge cells and read contents from it inside a worksheet using C library.

How to Merge Cells and Read Contents from it inside a Worksheet via C Library?

[worksheet mergeCellsInRange:@"A10:C10"];

//Get the cell at C10 or the upper-left cell if C10 belongs to a merge cell
BRACell *cell = [worksheet cellOrFirstCellInMergeCellForCellReference:@"C10"]