BeforeSheetRemove

fires before a sheet is removed

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

Parameters

sheetobjectthe object of a sheet

Returns

booleantrue to remove a sheet, false to prevent removing of a sheet

Example

spreadsheet.events.on("beforeSheetRemove", function(sheet) {
    console.log("The ", sheet.name, " sheet will be removed");
    return true;
});

Details

The sheet object contains the following parameters:

  • name - (string) the name of the sheet to be deleted
  • id - (string) the id of the sheet to be deleted

The event is blockable, returning false will prevent removing of a sheet.

Change log

added in v4.1

Back to top