0

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
 }
}
General Grievance
  • 4,555
  • 31
  • 31
  • 45
sam
  • 1
  • 1
  • 2
    Does this answer your question? [Cell coloring in google-spreadsheet fails if it is called from a cell, but works ok when called from the script.](https://stackoverflow.com/questions/24424977/cell-coloring-in-google-spreadsheet-fails-if-it-is-called-from-a-cell-but-works) – General Grievance Nov 05 '20 at 21:38
  • oh thanks il check it out – sam Nov 06 '20 at 00:25

0 Answers0