Skip to content
Spreadsheet Editor

WorksheetView

type WorksheetView = {
activeCell?: CellId;
activeLayout?: "normal" | "pageLayout" | "pageBreakPreview";
activeRangeIndex?: integer;
activeRanges?: CellRange[];
layoutScales?: WorksheetLayoutScales;
panes?: WorksheetViewFrozenPanes;
showGridLines?: boolean;
workbookView: integer;
};
Property Type Default value Description
activeCell? CellId undefined Cell that is selected by default when the sheet is visible.
activeLayout? "normal" | "pageLayout" | "pageBreakPreview" "normal" The layout used to display the worksheet.
activeRangeIndex? integer 0 Identifies which range within WorksheetView.activeRanges holds the cursor. Zero-based index. Required when activeRange is not a single contiguous range. If this value is out of range, use WorksheetView.activeCell. An active range index is required for cursor movement. Spreadsheet software generally allows a user to press Tab to cycle though selected cells, cycling through cells in the currently selected range before moving on to the next range selection. If cell ranges overlap (e.g. A1:E5 and D4:G8), it would be ambiguous which range is active when cell D4 is the selected cell. This property removes that ambiguity.
activeRanges? CellRange[] undefined Ranges of cells that are selected by default when the sheet is visible.
layoutScales? WorksheetLayoutScales undefined Scale (aka zoom level, aka magnification) applied when displaying a worksheet. Each different layout has its own scale.
panes? WorksheetViewFrozenPanes undefined Frozen panes. Freezing divides a sheet into two or four regions, each called a pane. All but one of the panes is frozen (their rows and columns are locked in place), and the panes’ rows and columns remain visible while scrolling. The final pane scrolls as usual.
showGridLines? boolean undefined Indicates whether a hairline-grid should be drawn when displaying the worksheet.
workbookView integer undefined The id of the workbook view this worksheet view belongs to. This is a zero-based index of the workbook view, as stored in the Workbook.views array. Within a single worksheet, each view must reference a distinct workbook view (i.e. no two views in the same worksheet can share the same workbookView id). However, views from different worksheets may reference the same workbook view.