0
votes

I wrote a script for a google spreadheet which is run by clicking on an image embedded in the spreadsheet. Everybody with the link to the spreadsheet can edit it (except some areas with formulas etc. which are protected). When I'm logged in with my google account, everything works fine, but when I log out and try using the spreadsheet like a "normal" user, nothing happens when I hit the image.

I didn't find anything in the options regarding "script sharing" etc. Would be awesome if someone could give me a hint (I'm quite new to google script...).

Thanks for your answers! Vincent

1
Have you looked at the execution transcript (from script editor, view/execution transcript) to see what is the error? The procedure described in the answer below does not apply to spreadsheet embedded scripts, any editor should be able to run the script after granting the necessary authorizations. - Serge insas
It only writes into the transcript when I run it while logged in - Vincent
Are the other users able to see / edit the function name linked to the image? Are you using old or new version of spreadsheets? And lastly, can other users run the script from the script editor? - Serge insas
Other users can right-click the image and see/change the linked function name They can not open the Script Editor though. Nothing happens when you click "Tools" > "Script Editor". (So no, they can't run it from the script editor). I am using the new version of spreadsheets (the ones with a green checkmark on the bottom). - Vincent
Thanks for your accurate answer :-) could you try to unprotect the protected ranges to see if it changes the behavior? - Serge insas

1 Answers

0
votes

Anonymous users can't run scripts. By design. Protected ranges, sharing and all the rest of it have nothing to do with your problem.

The user - whoever they happen to be - must be logged in to run any script. Scripts will simply be ignored for anonymous users.

So the solution in your case is to tell all your users that they must log in before being able to run a script.