OnEdit功能不适用于共享用户 [英] OnEdit function not working for shared users

查看:64
本文介绍了OnEdit功能不适用于共享用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Google电子表格中具有以下OnEdit脚本,该脚本在编辑复选框时会插入时间戳.当我进行编辑时,该操作已执行,但是当其他用户进行编辑时,该操作不起作用.感谢您的帮助.

I have the following OnEdit script in a Google spreadsheet that inserts a timestamp when a checkbox is edited. The action is preformed when I make the edit, but does not work when the edit is made by another user. Any help is appreciated.

function onEdit(e) {
  
  addTimestamp(e);
  
}
  

function addTimestamp(e){
  //variables
  var startRow = 3;
  var targetColumn = 6;
  var ws = "MasterList";
  
  //get modified row and column
  var row = e.range.getRow();
  var col = e. range.getColumn();
  
  if(col === targetColumn && row >= startRow && e.source.getActiveSheet().getName() === ws){
    e.source.getActiveSheet().getRange(row,19).setValue(new Date());
  }  
}

推荐答案

只要编辑电子表格,onEdit()函数就会运行.您可以在工具>"下检查任何故障.脚本编辑器>查看>执行.

The onEdit() function will run whenever the spreadsheet is edited. And you can check any failures under Tools > Script editor > View > Executions.

它不能在共享用户编辑下工作的原因是那些用户没有编辑目标单元格的权限.这意味着您已经设置了对单元格的保护.

The reason that it fails to work under shared users editing is those users do not have permission to edit the target cell. It means you had set the protection of the cell.

这篇关于OnEdit功能不适用于共享用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆