crypto-sheets icon indicating copy to clipboard operation
crypto-sheets copied to clipboard

SpreadsheetApp.getUi() cannot be called from this context

Open dan-mesa opened this issue 5 years ago • 0 comments

When creating a trigger, the onOpen function runs the createMenu function which throws the error in the issue title, and the scheduled trigger fails. I worked around that by creating an onTrigger function:

function onTrigger() {
  getData();
  getGlobal();
}

and executing that instead of onOpen strictly within the trigger. Everything else worked well, much better than the scraping that I had in place prior to finding this!

dan-mesa avatar Jun 23 '19 20:06 dan-mesa