This is a minimum working example to illustrate a problem I'm facing. I'm just a beginner, so any help is appreciated.
I received an error message that says Script function not found: sum(1,2)
. Can someone please tell me what's wrong with my code?
function onOpen() {
var ui = SpreadsheetApp.getUi();
ui.createMenu('Sum of two numbers')
.addItem('Example 1', 'sum(1,2)')
.addItem('Example 2', 'sum(2,3)')
.addToUi();
}
function sum(a, b) {
var total = a + b;
return total;
}