Append Excel Range
Append Excel Range
Section titled “Append Excel Range”Type: excel-append-range · Package: Excel Activities v1.0.6 · Output: —
Adds rows immediately below the last row with data on the sheet, starting at column A. Unlike Write Excel Range (which writes at a fixed position you specify), Append works out on its own where the existing data ends and adds right after it — ideal for accumulating data on a sheet over time without overwriting.
It takes a DataTable, a single row as a DataRow or a list of rows (since version 1.0.6) and writes only the cell values, not the row of column names (it adds no header).
How it works
Section titled “How it works”- It finds the last row with content on the sheet, looking at every column (rows that only have formatting don’t count).
- It writes
datastarting at the next row, always from column A. On an empty sheet, it starts at row 1. - The DataTable is written row by row, without headers (a DataRow, as a single row).
- In fast mode, it saves the file; in session mode, the change stays in memory until Excel Save or Excel Close.
If the file or the sheet don’t exist, they are created. Values are written with their type and DBNull leaves the cell empty — see how the data arrives. Accepts session or path — see the two modes.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
data | DataTable | DataRow | List<List<object>> | List<object> | — | The DataTable to add, a DataRow for a single row, a list of rows (arr(arr("a", 1), arr("b", 2))) or a single row as a list (arr("a", 1)). Values are written, without headers. Lists are accepted since version 1.0.6. |
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
session | ZoanExcelSession | — | Excel Open session (instead of path). |
path | string | — | Path to the .xlsx (fast mode: opens, saves and closes on its own; created if it doesn’t exist). |
sheet | string | int | — | Sheet name or index; created if it doesn’t exist. If omitted, the first sheet (or "Sheet1" in a new workbook). |
Output
Section titled “Output”This activity does not return a value.
Common errors
Section titled “Common errors”| Message | Cause and fix |
|---|---|
'data' is required. | data is empty or the expression returned null. |
'data' must be a DataTable, a DataRow, a list of rows (List<List<object>>) or a single row (List<object>). | data is something else (for example, a text or a dictionary). |
'data' mixes rows (lists) and single values: pass a list of rows or a single row. | The list has both rows and single values, like arr(arr("a", 1), "b"). Put each value inside a row. |
'session' or 'path' is required. | Neither session nor path is set. |
The process cannot access the file '…' because it is being used by another process. | The file is open in another program when saving. Close it or retry with Retry. |
Example
Section titled “Example”Add the rows of a DataTable at the end of a history file:
Append Excel Range path = "C:/logs/history.xlsx" data = records // a DataTableAdd one row at a time while looping through a table:
For Each items = orders itemVariable = row └─ activities: If condition = str(row["Status"]) == "Rejected" └─ then: Append Excel Range path = "C:/output/rejected.xlsx" data = rowRelated activities
Section titled “Related activities”- Append Excel Rows — accumulate DataTables with smart headers.
- Write Excel Range — write at a fixed position.