Append Excel Rows
Append Excel Rows
Section titled “Append Excel Rows”Type: excel-append-rows · Package: Excel Activities v1.0.0
Adds the rows of a DataTable to the end of existing data in a sheet. Its key behavior: writes the headers only if the sheet is empty. Thus, the first time it creates the table with its titles, and the subsequent times it only adds rows below, without repeating the header. It is the ideal activity to accumulate data in successive executions (a history, a daily log, growing results).
How it works
Section titled “How it works”Detects the last row used. If the sheet is empty, write the header row (the column names of the DataTable) first and then the data; if it already has content, add only the rows below. Accepts session or path — see the two modes.
Required parameters
Section titled “Required parameters”| Parameter | Editor | Description |
|---|---|---|
data | expression | The DataTable whose rows will be added. |
Optional parameters
Section titled “Optional parameters”| Parameter | Editor | Description |
|---|---|---|
session | expression | Excel Open session (instead of path). |
path | expression | Path to .xlsx (created if it does not exist; required if there is no session). |
sheet | expression | Name or index of the sheet. By default, the first /"Sheet1". |
Example
Section titled “Example”A daily process that accumulates the results in the same file:
... generar la DataTable "resultadosHoy" ...
Append Excel Rows path = = "C:/reportes/acumulado.xlsx" sheet = "Resultados" data = = resultadosHoyThe first run creates the sheet with headers; each following day adds the new rows below, without duplicating the titles.
Related activities
Section titled “Related activities”- Append Excel Range — add raw values.
- Write Excel Sheet — write a table from scratch.
- Read Excel Sheet — read the accumulated back.