When i copy a spreadsheet script/triggers don't work

后端 未结 1 564
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-07 11:00

I\'ve created a spreadsheet with a onEdit() trigger based in a function called fillvalues() and it works fine.

I need to make several copie

相关标签:
1条回答
  • 2021-01-07 11:28

    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) :

    function createOnEditTrigger(){
      var trigger = ScriptApp.newTrigger("myFunction").forSpreadsheet(SpreadsheetApp.getActiveSpreadsheet()).onEdit().create();
    }
    
    0 讨论(0)
提交回复
热议问题