How can I allow users with permissions of "View Only" the ability to execute an apps script in a spreadsheet?
I've created a custom menu choice triggered by onOpen() that launches the script fine for anyone with edit permissions. However, onOpen() does not run for anyone with only view/comment permissions (consistent with the documentation) and thus the menu is not created and there is no way to launch the script.
Ideally, I would like view only users to view and execute the script, but not modify it.
onOpen()that is a simple trigger versus an "Installed" trigger. But even an "installed" trigger will not run when the file is in "View Only" mode. So, if you want to prevent the user from seeing the code, you must use an Add-on. You can publish it unlisted. - Alan Wells