克隆具有公式/导入范围的Googlsheet [英] Clone Googlsheet which has formulas/importranges
本文介绍了克隆具有公式/导入范围的Googlsheet的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想克隆/复制一个Google工作表并将其放置在驱动器中,我目前具有的脚本适用于该元素,但由于公式/导入范围,其内容显示为空白
I would like to clone/copy a google sheet and locate it in a drive, The script i have at the moment is working for this element but the contents appear blank becuase of formulas/importranges
请帮助您.当前脚本是
function cloneGoogleSheet2() {
const destFolder = DriveApp.getFolderById("xxxxxxxxxxx");
const file = DriveApp.getFileById("xxxxxxxxxxxxxxx").makeCopy("xxxxxxxxx", destFolder);
const ss = SpreadsheetApp.openById(file.getId());
const sheets = ss.getSheets();
sheets.forEach(sh=>{
let rng = sh.getDataRange();
rng.copyTo(rng, {contentsOnly:true});
SpreadsheetApp.flush();
});
}
参考下面类似的问题
查看全文