I have a single script that I want to assign to a button on multiple different spreadsheets. If I create a button on the spreadsheets and reference the script, which is stored in another parent folder on Google drive, I get the error Script function myScript could not be found
. I can resolve this by going into each sheet with the button, selecting tools
, selecting Script editor
, and then pasting my script there. The problem with this is that myScript
depends on multiple other scripts, so for a dozen sheets, I'd have to copy over multiple scripts as described above to "attach" them to the spreadsheet and make them accessible via button. This is an obvious challenge for updating scripts in the future.
Is there a way for me to make my one project with all the scripts globally available, so I don't have to copy/paste the same scripts to every spreadsheet?
What you can do is to create one script and use it as a library, whereby you would then proceed to attach that library to any individual instances where you would have your worksheets and so on.
Here's the basic idea: Google Developers Guide: Libraries
This is what I've been doing in any case.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With