Google apps script importrange使用循环更改源url,将多个spreedsheet复制到一个中
我试图使用一个循环来使用importrange,其中包含一个var,但是我得到一个错误,说有一个“公式解析错误”Google apps script importrange使用循环更改源url,将多个spreedsheet复制到一个中,google-apps-script,google-sheets-api,Google Apps Script,Google Sheets Api,我试图使用一个循环来使用importrange,其中包含一个var,但是我得到一个错误,说有一个“公式解析错误” 可以更改url并导入数据。您不能简单地在字符串中插入变量,它会将其作为文本字符串,而不是值变量的值 更改此行: spreadsheet.getCurrentCell().setFormula('=importrange(value, "NOVO FUNIL!A20:T150")'); 为此: spreadsheet.getCurrentCell().setFormula('
可以更改url并导入数据。您不能简单地在字符串中插入变量,它会将其作为文本字符串,而不是
值
变量的值
更改此行:
spreadsheet.getCurrentCell().setFormula('=importrange(value, "NOVO FUNIL!A20:T150")');
为此:
spreadsheet.getCurrentCell().setFormula('=importrange(' + value + ', "NOVO FUNIL!A20:T150")');
它起作用了!谢谢,我真的是一个新的编码,我很确定我忘记了什么,但我看不到。。rsrs。谢谢你。
spreadsheet.getCurrentCell().setFormula('=importrange(' + value + ', "NOVO FUNIL!A20:T150")');