The Apps Script attached to the Sheet has a function that is meant to be called by any of the collaborators. But the Apps Script source contains a secret key. So my collaborators should not have read access to the script, just execute access. Is this not possible? Thank you.
Asked
Active
Viewed 77 times
0
-
Easy way is to put it in `userProperties` and give execute access through installable edit triggers+ checkbox. Other way is to publish a addon. – TheMaster Aug 20 '22 at 15:34
1 Answers
2
If you share a Sheet with the App Script:
- ( and you want other users to be able to edit the Sheet)
- it is not possible to keep the code hidden.
To do that you need to publish the Script as an add-on on Google Workspace Marketplace.
Please find more information on How to publish App Script Add-on
The general question has already been answered here

Damian
- 138
- 6
-
Thank you, may I further ask you if the problem can also be solved using stand alone Apps Script? May I ask how to use a function in a standalone GAS from a sheet formula? – Doochz Aug 22 '22 at 05:13
-
1Yeah, so for a start : you cannot solve it using stadalone Apps Script, but you can try creating a library out of the Apps Script file and then using the library in a different sheet. That could work as you intended it. 2: To use a formula you need to select a range and then set the formula ( sth like : SpreadsheetApp.getActiveSheet().getRange( a, b).setFormula("YOUR_FORMULA") – Damian Aug 22 '22 at 11:19