[英]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.