我只使用单个脚本将setValue设置为“”,然后设置Importrange的公式。基本上我这样做是为了让数据更新更快,因为我将为每5分钟设置一次触发器。
我收到有关缺少括号的错误消息。我读过有关插入的内容 “+”进入字符串,但我看不出我怎么能进入这个表达式。
有人可以帮我解决这个问题吗?
*function UpdateTarget() {
var ss = SpreadsheetApp.getActive();
var sheet = ss.getSheetByName("Teste");
sheet.getRange("B4").setValue("");
sheet.getRange("B4").setFormula("=importrange("1pG8nVt-wB4Sf4KvaXT_-0";if(day(today()-weekday(today())+2)<10;"0"&day(today()-weekday(today())+2);day(today()-weekday(today())+2))&"."&if(month(today()-weekday(today())+2)<10;"0"&month(today()-weekday(today())+2);month(today()-weekday(today())+2)) &"."&if(year(today()-weekday(today())+2)<10;"0"&year(today()-weekday(today())+2);YEAR(today()-weekday(today())+2))&"!BY34:KF83")");
}*
提前致谢!
蓝天,
答案 0 :(得分:0)
你只是引用了不匹配的内容。在双引号内使用单引号。它只是一个标准的JavaScript语法错误。