I would like to hide certain columns using office script for Excel Online workbook. I used the recorder to create the script. But when I ran it, it resulted in errors. Below is the recorded script:
function main(workbook: ExcelScript.Workbook) {
let lockbox = workbook.getTable("Lockbox");
// Set visibility of column(s) at range D:P on lockbox to true
lockbox.getRange("D:P").setColumnHidden(true);
// Set visibility of column(s) at range R:V on lockbox to true
lockbox.getRange("R:V").setColumnHidden(true);
// Set visibility of column(s) at range AB:AB on lockbox to true
lockbox.getRange("AB:AB").setColumnHidden(true);
// Set visibility of column(s) at range AE:AO on lockbox to true
lockbox.getRange("AE:AO").setColumnHidden(true);
}
The Problems are below, but don't understand why it's not working:
[4, 19] Expected 0 arguments, but got 1.
[6, 19] Expected 0 arguments, but got 1.
[8, 19] Expected 0 arguments, but got 1.
[10, 19] Expected 0 arguments, but got 1.