I wrote I simple Excel Script which works online pretty well, but if I use the same Script with Power Automate I get an error.
Here ist the Script:
function main(workbook: ExcelScript.Workbook)
{
let sheet = workbook.getActiveWorksheet();
let range = sheet.getUsedRange();
let rows = range.getRowCount();
let cols = range.getColumnCount();
for (let row = 2; row <= rows; row++) {
}
}
I am getting the message: Runtime error Line 5: Cannot read property 'getRowCount' of undefined
Does anybody know why this message occurs only with Power Automate and how to solve it?