Skip to main content

Excel line writer

Generate an Excel file on which you can append multiple rows at the given sheet.

The writer can also start from an existing workbook used as a template: the template's content and formatting are preserved, and unless a starting line is set, new rows are appended after the template's last used row.

Cell contents adapt to the value written:

  • Writable types — empty, date, time, datetime, text and number values can be written; any other value type fails the run.
  • SVG embedding — a text cell whose content starts with <svg (or an XML prolog followed by <svg) is rasterized to PNG and embedded as an image in the cell. The column width and row height are automatically grown to fit the image, capped at Excel's limits (255 characters wide, 409 points tall); an image too tall for the cap is scaled down to fit its row.
  • Multi-line text — text that wraps over several lines gets text wrapping enabled and the row height grown to fit (capped at 409 points).
Example
# Configuration:
Sheet: SHEET_1
Headers: A -> Name | B -> Weight

# Data input:
Excel row 1: A -> Apple | B -> 30gr
Excel row 2: A -> Ham | B -> 12kg

# Output:

| A | B |
|-----------------|
1 | Name | Weight |
2 | Apple | 30gr |
3 | Ham | 12kg |
|-----------------|
| SHEET_1 |

Parameters

Sheetnamerequired
The name of the Excel sheet to write.
Headers

The headers to write in the Excel file. The headers are written in the first row. (For example: A -> Name | B -> Weight)

Starting line

One-based line number where the first record is written. Earlier lines are left untouched, which is useful to preserve templates with header rows. When unset, rows are appended after the template's last used row or, without a template, written from row 1 (row 2 when headers are configured).

Input

Excel rowrequired

All the Excel rows to append to the Excel file. Each row is an object keyed by column letter (A, B, C…); a key that is not a valid Excel column reference fails the run.