简体   繁体   English

我无法使用谷歌应用脚本隐藏谷歌表格的最后一列

[英]I can't hide the last column of a google sheet using google apps scripts

so I have this sheet that I need to modify using a script as I am producing a large number of sheets and can't do everyone manually:所以我有一张需要使用脚本修改的工作表,因为我正在制作大量工作表并且不能手动完成每个人:

now this is the code that I am using that is supposed to hide the last column "AA" from the sheet beside some other things:现在这是我正在使用的代码,它应该在其他一些东西旁边隐藏工作表中的最后一列“AA”: 在此处输入图像描述

every line is working as expected except the line where I try to hide column AA is producing this error and I've already tried a lot of variations to this line all resulting to this error: "Exception: Those columns are out of bounds."每一行都按预期工作,除了我试图隐藏 AA 列的那一行产生了这个错误,我已经尝试了很多对这一行的变体,所有这些都导致了这个错误:“异常:那些列超出范围。” so any help would be appreciated, thank you.所以任何帮助将不胜感激,谢谢。

as specified by https://stackoverflow.com/users/14265469/yuri-khristich , using SpreadsheetApp.flush() before attempting to hide the last column in the sheet worked.按照https://stackoverflow.com/users/14265469/yuri-khristich的规定,在尝试隐藏工作表中的最后一列之前使用 SpreadsheetApp.flush() 。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在谷歌应用程序脚本中使用setValues屏蔽值? - How can I mask values using setValues in google apps scripts? 如何使用谷歌脚本自动将表单响应从谷歌表格移动到谷歌文档? - How can I automate moving form responses from a google sheet to a google doc using google scripts? 使用 Google Apps 脚本,如何替换 Google 表格模板中的文本以制作新表格? - Using Google Apps Script, how can I replace text in a Google Sheets template to make a new Sheet? 如何在 Google Sheet 上的 Apps Scripts 中使用 google API? - How to use google API in Apps Scripts on Google Sheet? 如何使用Google Apps脚本以html中的链接形式返回一组网址 - How can I return an array of urls as links in html using google apps scripts Google表格脚本 - Google Sheet scripts 如何使用 Google App Scripts 在学生考勤表的最后一行添加彩色条纹? - How to add a color stripe to every last row of a student attendance sheet using Google App Scripts? Google Apps 脚本 — 使用 getdraft() 方法不起作用 - Google Apps Scripts — Using getdraft() method not working 运行 2 个 Google Apps 脚本 - Run 2 Google Apps scripts 最近24小时内Google Apps脚本或可视化API有什么变化? - Anything change with Google Apps Scripts or Visualization API in the last 24 hours?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM