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, Modify and Manipulate .xlsx Spreadsheet. It allows to Manage Multiple Worksheets, Cell Formatting, Merge and Unmerge & So on.

What is XlsxReaderWriter?

Today’s modern world relies heavily on data, Excel files (.xlsx) play a crucial role in storing, reporting, and analyzing information. If you’re a software developer, being able to work with XLSX files using code is quite beneficial. Nevertheless, dealing with Excel files in C programming can be tough because of the intricate Office Open XML (OOXML) format. XlsxReaderWriter is a handy Objective-C library that makes reading and writing .xlsx files a breeze. This user-friendly and effective tool allows you to easily handle Excel spreadsheets without needing Microsoft Excel or complicated third-party software. With this library, developers can create tailored apps that interact with Excel files, facilitating data management, reporting, and automation.

Software Developers working on iPhone / iPad and macOS and applications can use XlsxReaderWriter to integrate Excel spreadsheet functionalities directly into their apps. The library provides an intuitive API to create new XLSX spreadsheets, manage XLSX data, format spreadsheet cells, handle formulas, merge rows and columns, add new worksheets, format cells and rows, add hyperlinks to cells, and even embed images, making it ideal for apps that require spreadsheet capabilities. It is designed to be lightweight, portable, and dependency-free, making it an ideal choice for developers working on embedded systems, cross-platform applications, or projects with strict performance requirements.

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"]