I've created a spreadsheet with a onEdit()
trigger based in a function called fillvalues()
and it works fine.
I need to make several copies of this spreadsheet because it is used to make work reports, but when I make a copy the script doesn't work because the triggers are inactive or it needs authorization to run.
How can I overcome this to copy the trigger function with the new spreadsheet and to ask permission when the spreadsheet open?
Each user will have to authorize and create the triggers for their copy. You can write a script that will do that for them in a function that they would run from a menu item or from a button/drawing/image in the sheet.
The code is really straightforward and goes like this (replace 'myFunction' with your function name) :