Working with Packaging

Overview

This guide explains how Aspose.Cells FOSS for Java reads and writes XLSX files using the OOXML ZIP package format. The serializer reads all required parts from the ZIP archive and writes well-formed XML into the correct entry paths on save.

XLSX as a ZIP Package

An .xlsx file is a ZIP archive containing XML parts. The primary worksheet XML lives at xl/worksheets/sheet1.xml. The workbook part is at xl/workbook.xml. Shared strings are stored in xl/sharedStrings.xml. These parts are produced automatically by Workbook.save().

Save Options

The Workbook.save(path) method produces a valid .xlsx file. Saving is currently limited to the .xlsx format:

import com.aspose.cells_foss.Workbook;
import com.aspose.cells_foss.Worksheet;

try (Workbook workbook = new Workbook()) {
    WorksheetCollection sheets = workbook.getWorksheets();
    Worksheet sheet = sheets.get(0);
    sheet.getCells().get("A1").putValue("Hello, XLSX");
    workbook.save("output.xlsx");
}

Supported Formats

FormatExtensionReadWrite
Excel Open XML.xlsx

See Also

 English