I've been using getRangeByIndexes as it seems to be the best way to use numbers to get Ranges in Office-JS. Problem I'm having is that when I need to use entire row/columns, I've resorted to the below. I read up and looks like number of rows/cols hasn't changed in a long time, but I know in vba I used rows.count to make sure the code was dynamic, whatever version of Excel it would use the number of rows on a spreadsheet.
Is there anything similar in Office-JS?
const Excel_Worksheet_Lengths_Obj = {
"total_rows": 1048576,
"total_cols": 16384,
}
var ws = context.workbook.worksheets.getActiveWorksheet()
var Method_Headers_Rng = ws.getRangeByIndexes(0,0,1,Excel_Worksheet_Lengths_Obj.total_cols)