google-sheetsgoogle-apps-scriptspreadsheet-protection

Allow script to edit locked cells


I have a complex spreadsheet where most of the sheet is locked and the user can only edit a handful of cells which triggers a bunch of calculations. This used to work fine but the problem now is I have added a drawing which I attached a script to so it acts as a button. Doing this forces the user to have to authorize and now the scripts run as that user so when the script tries to update cells that are locked to the user it fails.

How can I make it so a user can't type into cells, but my scripts can still update them. Basically I want the script to have full access to the sheet, not restricted by user permissions.


Solution

  • Workaround#1 -Service account:

    Workaround#2 - Installable triggers:

    Related: