ive been trying to change the background color of a cell In google sheets and it just keeps saying "error: exception: you do not have permission to call setbackground." this is my code
function change() {
var sheet = SpreadsheetApp.getActiveSheet();
var range = sheet.getRange("A1");
range.setBackground("red");
}
I have already looked all over the internet and Im not sure why it keeps saying this. please help me thanks.
this is what I'm trying to do.
function isChecked(cell){
if(cell == true){
return true;
// set background red
} else {
return false;
// set background green
}
}