Script won't open another spreadsheet properly

前端 未结 1 569
慢半拍i
慢半拍i 2021-01-27 14:26

My script quits when I use openById().

The script is supposed to detect when a user has modified two adjacent columns in a master list spreadsheet (i.e. user enters the

相关标签:
1条回答
  • 2021-01-27 15:06

    You won't be able to do this with a simple trigger (it won't have the right authorization), use an installable trigger for your function onEdit for this purpose instead. This will prompt you for the authorization it needs to run properly.

    The below script should set it up for you, all you need to do is run it once and you should be good to go.

    function createSpreadsheetEditTrigger() {
      var ss = SpreadsheetApp.getActive();
      ScriptApp.newTrigger('onEdit')
          .forSpreadsheet(ss)
          .onEdit()
          .create();
    }
    
    0 讨论(0)
提交回复
热议问题