0

I have programmed a script in a Google Sheet to treat the data stored in this script. This script runs automatically based on time.

I use a Google Sheet per month, so I make a copy of this Sheet with its programmed script every month. I modify the date and rename the file.

Nervertheless when I make the copy, it's necessary to get permissions in Google Apps Script to run the script. I would like to program a script that makes the copy, rename the file, changes the date and gets permission automatically. Making copy, renaming and changing date are easy, but I don't know how get permission automatically. Is it possible? Anyone can help me?

Kos
  • 4,890
  • 9
  • 38
  • 42
  • 3
    You can't set permission automatically, it would defeat the purpose of permissions if it were possible. Always use the original sheet and every month make a copy of it and then rename your original sheet instead of using the copy. – James D Jul 19 '18 at 10:34
  • 1
    Consider deploying your script as Sheets add-on, see https://stackoverflow.com/a/47605538/ – Kos Jul 19 '18 at 10:57
  • It's a great idea! Thanks! – Pepe Lloret Jul 19 '18 at 11:01
  • Could you reset the original Sheet? Archive all the data from the current Sheet to another Sheet, clear all current data from current Sheet, keep using current Sheet. That way, you don't need to re-authorize IF you don't need the script in the archived files. – Alan Wells Jul 19 '18 at 15:08
  • Yes, I will do it. It's a perfect solution! Thanks! – Pepe Lloret Jul 20 '18 at 10:36

0 Answers0