📜  脚本编辑器谷歌工作表创建新工作表 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:31.997000             🧑  作者: Mango

代码示例1
function onOpen() {
    var activeSpreadsheet = SpreadsheetApp.getActiveSpreadsheet();
    var yourNewSheet = activeSpreadsheet.getSheetByName("Name of your new sheet");

    if (yourNewSheet != null) {
        activeSpreadsheet.deleteSheet(yourNewSheet);
    }

    yourNewSheet = activeSpreadsheet.insertSheet();
    yourNewSheet.setName("Name of your new sheet");
}