I have created an addon using this guide.
code.gs
function onOpen() {
SpreadsheetApp.getUi().createAddonMenu()
.addItem('Start', 'showSidebar');
}
function showSidebar() {
const ui = HtmlService.createHtmlOutputFromFile('index').setTitle('Sample');
SpreadsheetApp.getUi().showSidebar(ui);
}
index.html
<!DOCTYPE html>
<html>
<head>
<base target="_top">
</head>
<body>
<h1>Works</h1>
</body>
</html>
It says "If you switch back to document and reload you will see a submenu under Add-ons menu.
But I could not find my addon submenu, I think the quickstart guide is outdated.
Please guide me, How to test the addon on google sheet.
Best Answer
The problem is that the
onOpen
function is incomplete;.addToUi();
is missing.This is the
onOpen
function on the referred guide