How to remove an Extensions submenu item in Google Sheets?

Viewed 47

I am using the following code in my Apps Script Editor Add-On to add a menu item:

function onInstall(e) {
  onOpen();
}

function onOpen() {
  var ui = SpreadsheetApp.getUi()
  ui
  .createAddonMenu()
  .addItem("Open Search Sidebar", "createAndShowSidebarContent")
  .addToUi();
}

During development, we were using the features of the add-on in a shared Google Sheet by just adding the code manually, via Extensions --> Apps Script.

Running that code, while it was bound to Sheet, added a sub-menu item under Extensions as:

sheet-name --> Open Search Sidebar

Now that I have the add-on approved and in Google Workspace Marketplace, I removed the bound code from the Sheet and installed the Add-On. When run as an Add-On, a second sub-menu item is added to Extensions as:

addon-name --> Open Search Sidebar

My question is how do I get rid of the first menu item that was created before it was an Add-On: "sheet-name --> Open Search Sidebar"?

[ The only SO answer that I found for removing menu items is this: https://stackoverflow.com/a/60179904/1978840 which is not viable for the Extensions menu. ]

1 Answers

I think that the correct answer is to remove the Apps Script code for the Google Sheet and then have a bit of patience and the menu item will go away!

That's what happened 2 days after I installed the Add-On.

Related