Skip to main content

beforeSheetRemove

fires before a sheet is removed

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

Parameters:

sheet: object - the object of a sheet

Returns:

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

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