好的,我对于SO非常新颖,并且对JS和Sheets也很新颖。我正在写一张工作表,每个班次有3个班次,首页和4页。除了轮班时间,上午,下午和新台币,每个班次的每个相应的表格都是相同的。 必须处理一些胖手指的人,我认为最好保护床单和打开范围可以填写。启动时只显示首页。我提供了一个开始和结束转换选项的菜单。运行开始班次,并显示相应的班次页面,然后运行结束班次,他们被隐藏。 问题是,我不运行此显示/隐藏,并且作为床单被保护既不能用户。是否有可能让JS的一部分以拥有者权限运行,而不管谁通过菜单调用它? 从可安装的触发器可能是可能的,但是我还没有从菜单项中找到如何操作。
解决方案我尝试创建一个改变单元格值的菜单项。不幸的是,它不会触发onEdit事件处理程序。所以,我怕你可以从菜单项中做到这一点。解决方法是将验证规则添加到单元格以创建下拉菜单。
对于那些对步骤感兴趣的人:
首先,工作流程:
- 电子表格有一个名为 Shift
- 用户可以将值更改为开始,结束或
- 设置相应的保护当Shift的值改变时
下面是步骤:
Ok I'm very new at SO and and reasonably new with JS and Sheets. I am writing a sheet for work that runs over 3 shifts with a front page and 4 sheets for each shift. Each corresponding sheet for every shift is identical except for the shift time, AM, PM, and NT. Having to deal with some fat fingered people I thought it would be best to protect the sheets and open ranges that can be filled in. On start up only the front page shows. I supply a menu with Start and End shift options. Run Start shift and the appropriate shift pages are shown, and then run End Shift and they are hidden. The issue is that I don't run this show/hide and as the sheets are protected neither can the user. Is it possible to have a section of JS run with owner privilege regardless of who invokes it via the menu? It may be possible from an installable trigger but I have not yet hunted down how from a menu item.
解决方案I tried creating a menu item which changes a cell value. Unfortunately it won't trigger the onEdit event handler. So, I'm afraid you can do it from a menu item. A workaround would be adding validation rule to a cell to create a drop-down menu.
To those interested in the steps:
First, the workflow:
- The spreadsheet has a cell called "Shift"
- The user can change the value to "Start", "End", or ""
- Set the appropriate protection when the value of "Shift" changes
Here are the steps:
更多推荐
Google工作表,运行作为所有者的功能
发布评论