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

安稳与你 提交于 2019-11-27 09:38:41

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 of Apps Scripts, custom functions never ask users to authorize access to personal data. Consequently, they can only call services that do not have access to personal data

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!