Skip to main content

beforeSheetChange

fires before changing the currently active sheet

beforeSheetChange: (sheet: ISheet) => void | boolean;

Parameters:

sheet: object - the object of the currently active sheet

Returns:

True to change the active sheet, false to prevent the active sheet from being changed.

Example

spreadsheet.events.on("beforeSheetChange", function(sheet) {
console.log("The active sheet will be changed" );
return true;
});

The sheet object contains the following parameters:

  • name - (string) the name of the currently active sheet
  • id - (string) the id of the sheet

The event is blockable, returning false will prevent changing of the active sheet.

Change log:

added in v4.1