I have created the following simple function:
function test(r,c) {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
sheet.getRange(r,c).setBackground("red");
return 1;
}
In the spreadsheet, I write "=test(row(),column())
This results in ERROR with the following message: Error: You do not have permission to call setBackground (line 3).
It is NO problem if I create another function call in the script as follows:
function test_the_test(){
test(5,4);
}
Why can't I call the test function from the spreadsheet cell?
Thank you in advance