Date TypeError:无法读取属性";资料来源;从未定义。(第2行,文件“代码”)
我在脚本中有一些代码工作得很好,现在出于某种原因,它给了我这个问题标题中的错误 代码如下Date TypeError:无法读取属性";资料来源;从未定义。(第2行,文件“代码”),date,google-apps-script,triggers,watch,stamp,Date,Google Apps Script,Triggers,Watch,Stamp,我在脚本中有一些代码工作得很好,现在出于某种原因,它给了我这个问题标题中的错误 代码如下 function onEdit(e) { var sheet = e.source.getActiveSpreadsheet(), columnToWatch = 10, columnToStamp = 9, //change all of these to your needs...1 is column A, 2 is column B, etc
function onEdit(e) {
var sheet = e.source.getActiveSpreadsheet(),
columnToWatch = 10,
columnToStamp = 9, //change all of these to your needs...1 is column A, 2 is column B, etc
excluded = ["KEY CODE","Form Responses 1","Hub List"]; //add names of sheets/tabs to this
list. The script will not work on these sheets.
if (e.source.columnStart !== columnToWatch || !e.value || excluded.indexOf(sheet.getName())
> -1) return;
sheet.getRange(e.source.rowStart, columnToStamp)
.setValue(new Date()).setNumberFormat("dd.MM.yy");
}
任何帮助都将被禁止 您是否介意共享您的工作表的修订版本,以便我们可以根据您的用例提供更可靠的解决方案?如果您从编辑器运行此代码,它将始终产生此错误,
e
是一个,它仅作为事件的结果存在(本例中为编辑)。您是否介意共享您的工作表的修订版本,以便我们可以根据您的用例提供更可靠的解决方案?如果您从编辑器运行此代码,它将始终产生此错误,e
是,它仅作为事件的结果存在(在本例中为编辑)。