Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google apps script 在Google工作表中取消隐藏列的录制宏将不会运行_Google Apps Script_Google Sheets_Google Sheets Macros - Fatal编程技术网

Google apps script 在Google工作表中取消隐藏列的录制宏将不会运行

Google apps script 在Google工作表中取消隐藏列的录制宏将不会运行,google-apps-script,google-sheets,google-sheets-macros,Google Apps Script,Google Sheets,Google Sheets Macros,录制的宏如下所示: function Unhide() { var spreadsheet = SpreadsheetApp.getActive(); spreadsheet.getRange('A:P').activate(); spreadsheet.getActiveSheet().showColumns(0, 16); }; 尝试执行宏时,它会停止并显示以下错误消息: 例外:这些列超出了范围 尝试将您的起始索引切换为1 你的工作表中有多少列?就

录制的宏如下所示:

 function Unhide() {
    var spreadsheet = SpreadsheetApp.getActive();
      spreadsheet.getRange('A:P').activate();
      spreadsheet.getActiveSheet().showColumns(0, 16);
    };
尝试执行宏时,它会停止并显示以下错误消息:

例外:这些列超出了范围


尝试将您的起始索引切换为1


你的工作表中有多少列?就是这样。谢谢!可能列0不存在!事实并非如此。第0行也不存在。所有这些都是从1开始的。
function Unhide() {
var spreadsheet = SpreadsheetApp.getActive();
  spreadsheet.getRange('A:P').activate();
  spreadsheet.getActiveSheet().showColumns(1, 16);
};