Google Script Error (no permission) -


this simple clearcell() script shown below works fine when run script editor, when called spreadsheet with

=if(c1<>"",clearcell(),) 

i you not have permission call clear content (line 3)

function clearcell() { var sheet = spreadsheetapp.getactive().getsheetbyname('sheet1'); sheet.getrange('b1').clearcontent();  } 

the permissions custom functions different regular apps script code permissions. when using spreadsheet service, includes spreadsheetapp, "read only". clearcontent() method not "read only". it's changing data in sheet. though it's not "set" method, it's still not "read only".

this behavior described in documentation @ following link:

google documentation - using apps script services

you need use either simple onedit(e) function, or installable "on change" function.


Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -