Skip to content
Cellatrix

Workbook

Represents a spreadsheet workbook.

new Workbook(jsf: Workbook): Workbook;
Parameter Type
jsf Workbook

Workbook

Property Type
_sheets WorkSheet[]
calcMode "auto" | "autoNoTable" | "manual"
charts Record<string, Chart>
comments CommentsManager
epoch 1900 | 1904
filename string
formulas string[]
images? Record<string, string>
instanceId number
iterate boolean
iterateCount number
iterateDelta number
name string
names DefinedName[]
notes NotesManager
pivots PivotManager
styles StyleManager
tables TableManager
theme? ThemeManager
views ViewManager
getSheet(sheetName?: string | null): WorkSheet | null;

Returns the specified worksheet instance by name or the first sheet if no name is provided.

Parameter Type Description
sheetName? string | null The name of the worksheet.

WorkSheet | null


getSheetByIndex(index?: number | null): WorkSheet | null;

Returns the specified worksheet instance by index or the first sheet if no index is provided.

Parameter Type Description
index? number | null The index of the table.

WorkSheet | null


getSheets(): WorkSheet[];

Returns a list of worksheet instances.

WorkSheet[]


getSheetSize(sheetName: string | null): [number, number];

Returns the size of the specified worksheet instance as a tuple of [columns, rows].

Parameter Type Description
sheetName string | null The name of the worksheet.

[number, number]


setColumnWidth(
sheetName: string,
column: number,
width: number
): void | undefined;

Sets the width of a specified column in a worksheet by its (zero-based) index.

Parameter Type Description
sheetName string The name of the worksheet.
column number The 0-based index of the target column.
width number The width to set, in pixels.

void | undefined


setRowHeight(
sheetName: string,
rowNum: number,
height: number
): boolean | undefined;

Sets the height of a specified row in a worksheet by its (zero-based) index.

Parameter Type Description
sheetName string The name of the worksheet.
rowNum number The 0-based index of the target row.
height number The height to set, in pixels.

boolean | undefined