onOpen not executing?

后端 未结 4 1289
长发绾君心
长发绾君心 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:39

    See if this works

    function showSideBar() {
       SpreadsheetApp.getUi()
        .showSidebar(HtmlService.createTemplateFromFile('tipA')
            .evaluate()
            .setTitle('Some title'));
    }
    

    and use an installable onOpen trigger on this function. As the previous poster already mentioned, I also don't believe you can show a sidebar (which requires authorization) on a simple onOpen trigger (which doesn't require authorization).

提交回复
热议问题