I Try to create a office script, that do the same as this excel makro:
Sub clear()
Rows("2:" & Rows.Count).ClearContents
End Sub
my office Script looks like this:
function main(workbook: ExcelScript.Workbook)
{
let table = workbook.getTable("Table1");
let rowCount = workbook.getTables()[0].getRowCount();
table.deleteRowsAt(2, rowCount);
}
i get following error:
Line 9: Cannot read property 'deleteRowsAt' of undefined
i dont get why the property "deleteRowsAt" is undefined.
it needs to be a office script, because i want to automate a process with power automate.