Skip to content

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).

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.

ParameterEditorDescription
dataexpressionThe DataTable whose rows will be added.
ParameterEditorDescription
sessionexpressionExcel Open session (instead of path).
pathexpressionPath to .xlsx (created if it does not exist; required if there is no session).
sheetexpressionName or index of the sheet. By default, the first /"Sheet1".

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 = = resultadosHoy

The first run creates the sheet with headers; each following day adds the new rows below, without duplicating the titles.