Skip to content

Function: hideWorksheet()

ts
function hideWorksheet(workbook: Workbook, identifier: string | number | RegExp): void;

Defined in: src/excel/excel.tsx:322

Hide a worksheet in the workbook. Accepts a name, 1-based index, or RegExp. Does nothing if the worksheet is not found or if hiding it would leave no visible sheets.

Parameters

ParameterTypeDescription
workbookWorkbookThe ExcelJS workbook instance.
identifierstring | number | RegExpA worksheet name, 1-based index, or RegExp pattern.

Returns

void

Example

ts
hideWorksheet(workbook, 'Scratch');
hideWorksheet(workbook, 2);
hideWorksheet(workbook, /^Draft/);

Matterway Assistant SDK Documentation