I tried to create a function for google spread sheet. However Appscipt editor doesn't compile my function and throws error, "Error Message: TypeError: SpreadsheetApp.getUi(...).createMenu(...).addItem(...).addItem(...).addSeperator is not a function"
CodePudding user response:
I think is just a typo addSeperator
to addSeparator
:
Code.gs
const addToUI = () => {
SpreadsheetApp.getUi().
createMenu('New Menu')
.addItem('test1', 'test')
.addItem('test2','test')
.addSeparator().addToUi()
}
const test = () => console.log("ECO")
You can follow this guide for more reference.