1
我看到谷歌開發人員發佈這裏注意。 https://developers.google.com/apps-script/releases/ 在2015年8月4日,他們說:「增加了以下方法對電子表格服務,讓腳本來控制‘警告爲本’爲電子表格保護範圍」如何在谷歌電子表格中使用保護setWarningOnly(warningOnly)
* Protection.isWarningOnly() * Protection.setWarningOnly(warningOnly )
我試着做警告基於保護片,與谷歌Apps腳本。(它應該是有一些無保護的細胞)
我想這樣的,但它不工作。
var sheet = SpreadsheetApp.getActiveSheet();
var protection = sheet.protect().setDescription('Sample protected sheet').isWarningOnly()
var unprotected = sheet.getRange('B2:C5');
protection.setUnprotectedRanges([unprotected]);
protection.setWarningOnly(warningOnly)
有沒有人成功使用warningOnly方法? 請告訴我如何使用這個。
感謝您的幫助!現在我明白了setWarningOnly的工作原理!你是對的,它需要設置「真實」!再次,謝謝你! – idotassadar