Skip to content

Write Excel Sheet

Type: excel-write-sheet  ·  Package: Excel Activities v1.0.0

Writes a complete DataTable to an Excel sheet, including the column names as the first row. It is the most direct way to generate a report or dump data to Excel. Create the file and sheet if they do not exist.

Takes the DataTable of data and writes it to the indicated sheet, starting at startCell. By default clears the sheet before (clearSheet = true) and writes the headers (writeHeader = true). Accepts session or path — see the two modes.

ParameterEditorDescription
dataexpressionThe DataTable to write.
ParameterEditorDescription
sessionexpressionExcel Open session (instead of path).
pathexpressionPath to .xlsx (created if it does not exist; required if there is no session).
sheetexpressionSheet name (created if necessary). By default "Sheet1".
writeHeaderbooleanWrite the column names as the first row. By default true.
startCelltextTop left cell where to start. By default "A1".
clearSheetbooleanClean the sheet before writing. By default true.
Read Excel Sheet path = = asset("ventas.xlsx") → output: ventas
... procesar ...
Write Excel Sheet path = = "C:/salida/reporte.xlsx" sheet = "Resumen" data = = ventas