【发布时间】:2021-10-23 04:34:25
【问题描述】:
我正在尝试使用此代码将工作表复制到其他电子表格中。但是,有错误: [例外:指定的工作表必须是电子表格的一部分]
function copy_to_A() {
var source = SpreadsheetApp.getActiveSpreadsheet();
var destination = SpreadsheetApp.openById(Bestwise_id);
var tempsheet = source.getSheetByName('Bestwise-tocopy');
destination.insertSheet('New Sheet Name', 0, {template: tempsheet});
}
【问题讨论】:
-
异常发生在哪一行?这里缺少很多上下文。
标签: google-apps-script google-sheets google-sheets-api