Home > Blockchain >  Exception from sheet protection
Exception from sheet protection

Time:10-08

I have created a script that is working on automaticly asigning range protection to my sheets and specific users (based on their email adresses) are excluded from protection and can edit anything. This was the easy part. But when i make script that is supposed to edit protected cell it tells user that he is trying to edit a protected cell. I know it's obvious but i need to allow user to edit those specific cell when clicking on script but he cannot change it manualy.

To visualise: Script is typing "123" in cell "A1", but user that is starting a script cannot manualy type anything to cell "A1" Code for simple function:

function ABC() {
var arkusz = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Podsumowanie"); 
arkusz.getRange("A1").setValue("123");
}

enter image description here

In this sample, the checkbox is in cell B1. I have configured 2 sets of protected ranges, 1 for cell A1 where I am the only one who can edit it, and another for B2 where I have added a single test user who is able to edit the checkbox.

References:

  • Related