OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Google Apps Script/Google Sheets setNote causing permissions error

  • Thread starter Thread starter Aemarr
  • Start date Start date
A

Aemarr

Guest
I'm using Apps Script to make a custom function that sets the note of a specific cell in a spreadsheet, but I'm getting the error "Exception: You do not have permission to call setNote," even though the cell that's being targeted is the same cell that's calling the function. My code is:

Code:
var ss = SpreadsheetApp.getActive(); 
var sh = ss.getSheetByName("Sheet1"); 

function setCellNote(targRow, targCol, text, display) { 
  var cell = sh.getRange(targRow, targCol);
  cell.setNote(text); 
  return display;
}

and the call in the sheet is in cell A2 as =setCellNote(ROW(A2),COLUMN(A2),"test", "done")

I've tried using A1 notation, but I had to have the cell reference in quotes (meaning =setCellNote("A2"),...), and I need this to work across many cells, so the actual cell reference needs to automatically change as I copy the formula across many cells.

Continue reading...
 

Latest posts

M
Replies
0
Views
1
Mohit Pant
M
Top