I have a code that goes through the "hello" sheet and deletes all of the columns that contain the word B at the top of the column:
let ws = workbook.getWorksheet("hello");
let usedrange = ws.getUsedRange(true);    
let qtycol = usedrange.getColumnCount() - 1;
let values = usedrange.getValues();
for (let j = qtycol; j >= 0; j--) {
    let command = values[1][j];
    if (command == "B") {
        usedrange.getColumn(j).delete(ExcelScript.DeleteShiftDirection.left);
    }
}
When the file was smaller, there were no issues. But now that the file is a bit larger, I get teh following error:
Line 64: Range getColumn: Timeout
Line 64 is the line that starts with usedrange...
Is there a more efficient way of doing this? Would love to get feedback or other ideas.
Thank you!
 
     
    