Google apps script error: “You do not have permission to call protect” [duplicate]

Custom function run anonymously so the implicit consequence is that they can not do anything that requires authorization. Changing a range protection requires an authorization , that’s why you can’t use it and get the message you get… Same situation for getEffectiveUser(), it requires an authorization too. Reference in docs : Unlike most other types … Read more

Custom Functions with add-ons?

Answer According to Eric Koleda in [Code.gs – date_add_and_subtract]( https://github.com/google/google-apps-script-samples/blob/master/date_add_and_subtract/Code.gs) to make available the custom fuctions in an add-on it’s required to include at least one add-on menu, but this is not working at this time on testing mode. NOTE: The originally referred page was removed but the Date add and substract add-on sample code … Read more

You do not have permission to call openById

I thought that I would throw in a similar issue that I had which brought me to this question, where I received the error You don’t have permission to call by openById. In my case I was trying to call functions from translate.gs which I copied from this example: https://developers.google.com/apps-script/quickstart/docs Note that at the top … Read more

No permission to call msgBox in Google Apps Scripting

Custom functions will do nothing but return a value to a cell in which they reside unless the return an array which may affect contiguous cells. A custom function cannot initiate a message box(Browser.msgbox()) A custom function is a function entered as all or part of a formula in a spreadsheet cell that calls a … Read more