BeforeSheetChange

fires before changing the currently active sheet

boolean BeforeSheetChange(object sheet){ ... };

Parameters

sheetobjectthe object of the currently active sheet

Returns

booleantrue 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;
});

Details

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

Back to top