[英]Getting permission error with setvalue with google apps script on my google spreadsheet
[英]Google Spreadsheet User permission with Google Apps Script
这里是这个问题的解决方案。
在我的特定情况下,权限是“按工作表”而不是“按范围” 。
所以这里有一个小的工作代码:
var ss = SpreadsheetApp.getActive();
var protections = ss.getProtections(SpreadsheetApp.ProtectionType.SHEET);
for (var i = 0; i < protections.length; i++) {
protections[i].addEditor('theEmailYouWantEnabled@email.com');
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.