JExcel

Quite often there are requirements to either generate reports in the tabular format or process ready reports from Java code. For Microsoft Windows the most common way to store electronic spreadsheets is Microsoft Excel format (xls or xlsx).

JExcel (derivative from Java Excel) library provides an effective way to integrate MS Excel into Java Swing applications. You can easily read, write, create, modify or display MS Excel workbooks using a comprehensive Java Excel API. It’s so easy to work with Excel spreadsheets in Java using JExcel.

With JExcel library, you can work with workbook files (xls, xlsx), workbooks, spreadsheet, worksheet or even a specific range of cells in Java application. Modify cell values, cell number formats, formulas, etc. You can also print Excel documents.
Also, you can customize cell appearance, including text font, cell background and border, text alignment and orientation, etc. In other words with JExcel you have full control over xls in Java.

The use of the Java Excel API is very simple and intuitive for Java developers. It doesn't require a specific knowledge of MS Office programming.

Major Features

Automation of Excel files, workbooks, spreadsheets, worksheets, etc

JExcel provides full access to MS Excel functionality from Java:

  • Manage workbooks: create a new workbook, open an existing workbook and save a workbook in any format supported by the version of MS Excel installed on the computer.
  • Obtain and modify workbook additional information: workbook name, title, author, and file path, whether a workbook is protected by a password, whether a workbook is opened in read-only mode.
  • Manage workbook window properties: modify the window caption, size, zoom and window state.
  • Manage worksheets:
    • obtain worksheet by its name or index
    • obtain all worksheets in a workbook
    • add a new worksheet and assign the name of the new worksheet
    • move a worksheet to a specified position
    • remove a worksheet from a workbook.
  • Work with cells and ranges:
    • reference cells by coordinates, address or name
    • set and get values of different types
    • convert cells into ranges and vice versa
    • merge and unmerge cells
    • customize cell appearance, etc.
  • Work with ranges: reference range, convert range to cells, find values in ranges, obtain ranges intersection, merge/unmerge cells of a range.
  • Customize cells and ranges:
    • change a number format
    • customize text alignment and orientation
    • customize text font: font name, font size, general font styles, font underline style, font colour, font alignment style
    • change background pattern and colour in cells
    • border appearance customization: border colour, line style and line weight.

Ability to listen to and handle Excel workbook or worksheet events

With JExcel Workbook and Worksheet classes, you can add listeners to the events generated by a workbook or worksheet as well as process them by handlers to affect respectively the behavior of a workbook or worksheet.

MS Excel sends notifications about the following events:

  • Application Events: a new workbook is created, a workbook is opened
  • Workbook Events: a workbook is activated/deactivated, a new worksheet is added to a workbook, a workbook is saved/closed
  • Worksheet Events: a worksheet is activated/deactivated, a cell range of values is changed, a selection in a worksheet is changed, a double-click event, a right-click event

Ability to embed a workbook in a Java application

Using the JWorkbook class, you can add an Excel workbook into a Java Swing application just like an ordinary Swing component.

The JWorkbook component is an OLE container for an Excel workbook and provides functionality for working with its content:

  • open and save an embedded workbook
  • print an embedded workbook by displaying the Print dialog or without it
  • display a workbook in a static mode (read-only) or in a normal mode
  • listen to JWorkbook events:
    • a new workbook is created
    • a workbook is opened/saved or is closing
    • a workbook is switched to print preview mode or back

Ability to work with Native Peers and Thread Issues

Native peers are provided to allow you to work directly with COM interfaces of the MS Excel COM API to implement functionality that is not yet available in the JExcel API.

JExcel provides peers for the following classes: Application, Workbook, Worksheet, Range, and Cell.

What You Get With JExcel

  • JNIWrapper 3.x for Windows.
  • ComfyJ 2.x run-time key.
  • Free Runtime License to deploy JExcel inside your software to any number of client machines with no royalties to TeamDev.
For volume discounts please visit JExcel Purchase page.

Try JExcel

You can try capabilities and features of our library using online demo of JExcel.

Also you can download a fully-featured evaluation version of JExcel. The evaluation period is 30-days. To run evaluation version of JExcel you should get the evaluation license key.


Enjoy the pleasure of writing code in the Java language only!