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");
}
Button for invoking function ABC
How can i make this exception while invoking script? Thanks