Re: [Apps-Script] Custom Menu on Google Sheets Not Appearing After I run Code

779 views
Skip to first unread message

CBMServices Web

unread,
Jul 1, 2022, 2:07:09 PM7/1/22
to google-apps-sc...@googlegroups.com
Share the code and we can take a look at why it is not working.

The onOpen is a simple trigger, all code in it must not try to access any other services besides the document itself. Make sure there is no other functionality in the function besides the menu definition.


On Fri., Jul. 1, 2022, 11:03 a.m. Amietee Fuondjing, <amietee....@siriusxm.com> wrote:
I wrote a script that creates a custom menu using the onOpen() function but it does not show up in my toolbar even after I press run and refresh the page. I have checked and rechecked my syntax and it is correct. The code executes fine. Does anybody have any idea why it's still not showing up for me? Thanks.

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/ccbcc760-24a7-47fd-b676-84b330a6d34dn%40googlegroups.com.

Amietee Fuondjing

unread,
Jul 1, 2022, 2:16:33 PM7/1/22
to Google Apps Script Community
function onOpen()
{
var menu = SpreadsheetApp.getUi().createMenu('Sync to Calendar');
menu.addItem('Schedule events', 'scheduleEvent');
menu.addToUi;
}

cbmserv...@gmail.com

unread,
Jul 1, 2022, 2:32:31 PM7/1/22
to google-apps-sc...@googlegroups.com

You are missing () after addtoUI.

 

Change it to:

 

menu.addToUi();

Amietee Fuondjing

unread,
Jul 1, 2022, 2:35:09 PM7/1/22
to Google Apps Script Community
Sheesh! Thank you man you saved my a whole lot of headache.

game over

unread,
Feb 19, 2023, 4:46:09 PM2/19/23
to Google Apps Script Community
Reply all
Reply to author
Forward
0 new messages