Cell coloring in google-spreadsheet fails if it is called from a cell, but works ok when called from the script. -


i have created following simple function:

function test(r,c) {   var sheet = spreadsheetapp.getactivespreadsheet().getactivesheet();   sheet.getrange(r,c).setbackground("red");   return 1; } 

in spreadsheet, write "=test(row(),column())

this results in error following message: error: not have permission call setbackground (line 3).

it no problem if create function call in script follows:

function test_the_test(){   test(5,4);  } 

why can't call test function spreadsheet cell?

thank in advance

as explained in documentation, custom functions return values, cannot set values outside cells in. in circumstances, custom function in cell a1 cannot modify cell a5. of course true other methods such setbackground etc.


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -