💾app.deleteSheetByName()

GASappmethods ⟩ .deleteSheetByName()

⬆️ 內含於: app

  // 🔸 app.deleteSheetByName()
  deleteSheetByName(name) {

    const ss = app.spreadsheet;
    let sheet = ss.getSheetByName(name);

    if(sheet === null){ 
      Logger.log(`⚠️ app.deleteSheetByName:沒有「${name}」頁面。`);
      return;
    }

    return ss.deleteSheet(sheet); 
  },

Last updated