Skip to content

addArrayToSheet

On this page

Add an array-of-arrays to an existing worksheet, or create a new one.

Each inner array represents a row, and each element within it a cell value. Supports dense and sparse storage modes, origin offsets, date handling, and automatic type detection (number, boolean, string, date, error).

addArrayToSheet(worksheet: WorkSheet | null, data: any[][], opts?: AOA2SheetOpts): WorkSheet

Parameters

NameTypeRequiredDescription
worksheetWorkSheet | nullYesAn existing worksheet to append to, or null to create a new one
dataany[][]YesThe array-of-arrays containing raw cell values
optsAOA2SheetOptsNoOptional settings (origin, dense, dateNF, cellDates, UTC, date1904, nullError, sheetStubs)

Returns

WorkSheet

The updated or newly created worksheet