Home > Enterprise >  Cannot call SpreadsheetApp.getUi from this context
Cannot call SpreadsheetApp.getUi from this context

Time:11-05

I need help. I'm trying to make a backup of my worksheet that makes it take the data from the worksheet and put it in another worksheet but it's giving this error!

enter image description here

CodePudding user response:

SpreadsheetApp.getUi() can't be used in stand alone projects ejectuted from the script editor, it only works when the stand alone project is used as a Google Editor Add-On.

I know that your script is an stand alone project because the screenshot shows the share button.

In order to be able to use SpreadsheetApp.getUi() you should,

  1. test it as Editor Add-on
  2. use it as Editor Add-on
  3. use it from a script contained in a spreadsheet

Related

CodePudding user response:

I can solve the problem of SpreadsheetApp.getUi() but now I have the following problem Exception: Range not found

  • Related