onOpen not executing?

后端 未结 4 1249
长发绾君心
长发绾君心 2021-01-24 00:48

Hi guys im trying to display a sidebar on my google sheets every time it is opened. I am using the onOpen function and calling the html page, but it is not executing. When i run

4条回答
  •  清酒与你
    2021-01-24 01:29

    A simple trigger open function can't open a sidebar because it runs on AuthMode.LIMITED. You should use a function that runs on Auth.Mode.FULL to open a sidebar, like an installable trigger.

    I know that this isn't about add-ons but the following quote applies

    From https://developers.google.com/apps-script/add-ons/lifecycle#authorization_modes

    Note: Add-ons can't open sidebars or dialogs while executing in AuthMode.LIMITED. You can use menu items to open sidebars and dialogs since these run in AuthMode.FULL.

    The cannonical references are

    • https://developers.google.com/apps-script/guides/triggers/
    • https://developers.google.com/apps-script/guides/triggers/events

提交回复
热议问题