Skip to main content
almarefa.net

Back to all posts

How to Install OpenXLSX on Linux?

Published on
2 min read
How to Install OpenXLSX on Linux? image

Best Tools for OpenXLSX Installation on Linux to Buy in October 2025

1 Linux Pocket Guide: Essential Commands (Linux Pocket Guides)

Linux Pocket Guide: Essential Commands (Linux Pocket Guides)

BUY & SAVE
$16.03 $29.99
Save 47%
Linux Pocket Guide: Essential Commands (Linux Pocket Guides)
2 The Linux Command Line, 2nd Edition: A Complete Introduction

The Linux Command Line, 2nd Edition: A Complete Introduction

BUY & SAVE
$19.58 $39.99
Save 51%
The Linux Command Line, 2nd Edition: A Complete Introduction
3 Linux Essentials for Cybersecurity (Pearson It Cybersecurity Curriculum)

Linux Essentials for Cybersecurity (Pearson It Cybersecurity Curriculum)

BUY & SAVE
$74.28 $80.00
Save 7%
Linux Essentials for Cybersecurity (Pearson It Cybersecurity Curriculum)
4 Linux Cookbook: Essential Skills for Linux Users and System & Network Administrators

Linux Cookbook: Essential Skills for Linux Users and System & Network Administrators

BUY & SAVE
$41.99 $65.99
Save 36%
Linux Cookbook: Essential Skills for Linux Users and System & Network Administrators
5 Linux Pocket Guide: Essential Commands

Linux Pocket Guide: Essential Commands

BUY & SAVE
$28.11
Linux Pocket Guide: Essential Commands
6 The Software Developer's Guide to Linux: A practical, no-nonsense guide to using the Linux command line and utilities as a software developer

The Software Developer's Guide to Linux: A practical, no-nonsense guide to using the Linux command line and utilities as a software developer

BUY & SAVE
$30.00 $39.99
Save 25%
The Software Developer's Guide to Linux: A practical, no-nonsense guide to using the Linux command line and utilities as a software developer
7 Linux Pocket Guide

Linux Pocket Guide

  • AFFORDABLE PRICES VS. NEW BOOKS-GREAT VALUE FOR SAVVY SHOPPERS!
  • ECO-FRIENDLY CHOICE-SUPPORT SUSTAINABILITY BY BUYING USED.
  • UNIQUE FINDS-DISCOVER RARE TITLES AND HIDDEN GEMS IN OUR SELECTION!
BUY & SAVE
$18.13
Linux Pocket Guide
8 Fedora Linux 40 Essentials for Beginners: A Complete Guide to Installing, Customizing, and Using Fedora Workstation and Server for Daily Tasks, Programming, and System Administration

Fedora Linux 40 Essentials for Beginners: A Complete Guide to Installing, Customizing, and Using Fedora Workstation and Server for Daily Tasks, Programming, and System Administration

BUY & SAVE
$29.99
Fedora Linux 40 Essentials for Beginners: A Complete Guide to Installing, Customizing, and Using Fedora Workstation and Server for Daily Tasks, Programming, and System Administration
9 LINUX FOR HACKERS: LEARN CYBERSECURITY PRINCIPLES WITH SHELL,PYTHON,BASH PROGRAMMING USING KALI LINUX TOOLS. A COMPLETE GUIDE FOR BEGINNERS (HACKERS ESSENTIALS)

LINUX FOR HACKERS: LEARN CYBERSECURITY PRINCIPLES WITH SHELL,PYTHON,BASH PROGRAMMING USING KALI LINUX TOOLS. A COMPLETE GUIDE FOR BEGINNERS (HACKERS ESSENTIALS)

BUY & SAVE
$18.50
LINUX FOR HACKERS: LEARN CYBERSECURITY PRINCIPLES WITH SHELL,PYTHON,BASH PROGRAMMING USING KALI LINUX TOOLS. A COMPLETE GUIDE FOR BEGINNERS (HACKERS ESSENTIALS)
10 Python Essential Reference

Python Essential Reference

BUY & SAVE
$44.90 $49.99
Save 10%
Python Essential Reference
+
ONE MORE?

To install OpenXLSX on Linux, follow these steps:

  1. Open a terminal.
  2. Ensure that you have the necessary prerequisites to build and install OpenXLSX. These prerequisites typically include the CMake build system, a C++ compiler, and the zlib compression library. Install them if they are not already present on your system.
  3. Download the OpenXLSX source code from the official repository. You can either download a zip archive or clone the Git repository using the git command.
  4. Extract the downloaded zip archive or navigate to the cloned repository directory using the cd command.
  5. Create a build directory within the OpenXLSX source directory using the mkdir command.
  6. Navigate to the build directory using the cd command.
  7. Run the CMake build process to generate build files for your system. Execute the following command in the terminal: cmake ..
  8. After the CMake process completes successfully, build OpenXLSX by running the make command.
  9. Once the build process finishes, you can install OpenXLSX by running the sudo make install command. This will copy the necessary files to the appropriate system directories.
  10. Verify the installation by including the OpenXLSX headers in your C++ code and compiling it.

Remember to consult the OpenXLSX documentation and the specific guides for your Linux distribution to ensure a smooth installation.

What is the OpenXLSX documentation website?

The OpenXLSX documentation website can be found at the following link: https://openxlsx.readthedocs.io/en/stable/

What is the procedure to write data to an Excel file using OpenXLSX on Linux?

To write data to an Excel file using OpenXLSX on Linux, you need to follow the steps below:

  1. Install OpenXLSX library: Clone the OpenXLSX repository from GitHub: git clone https://github.com/troldal/OpenXLSX.git Navigate to the OpenXLSX directory: cd OpenXLSX Build the project: cmake . && make Install the library: sudo make install
  2. Include the necessary headers in your C++ program:

#include <OpenXLSX/OpenXLSX.h>

  1. Create and open an Excel workbook:

OpenXLSX::XLDocument doc; doc.create("./path/to/myfile.xlsx");

  1. Access a worksheet from the workbook:

OpenXLSX::XLWorksheet worksheet = doc.workbook().worksheet("Sheet1");

  1. Write data to the cells:

worksheet.cell("A1").value().setString("Hello"); worksheet.cell("B1").value().setString("World");

  1. Save and close the workbook:

doc.save(); doc.close();

That's it! You have successfully written data to an Excel file using OpenXLSX on Linux. Remember to replace ./path/to/myfile.xlsx with the desired file path.

What is the latest version of OpenXLSX?

As of my knowledge, the latest version of OpenXLSX is version 4.2.0, released on June 30, 2021.