klyn.io.xlsx.Workbook.Workbook
constructor

    public Workbook(filePath as String, mode as WorkbookMode = WorkbookMode.READ) throws IOException:

Description

Creates or reads a workbook.

The default mode is `WorkbookMode.READ`: the constructor loads an existing workbook. Use `WorkbookMode.CREATE` when starting a new file.

Parameters

- filePath XLSX file path.
- mode Opening mode.

Throws

- IOException if a workbook opened in read mode cannot be loaded.

Example

    workbook = Workbook("report.xlsx", WorkbookMode.CREATE)
    workbook.addWorksheet("Data")
    workbook.close()