Hello,
I am building a Cloud flow that runs an Office Script on each .xlsx file in a folder. When I run the script within a particular .xlsx instance in Excel Online, the script works perfectly. But, when using the 'Run Script' Excel connection/action in PA, I get the following error: "\nRuntime error: Line [line number]: Cannot read property 'getRange' of undefined\r"
What am I doing wrong? Is this a relative reference (that is disallowed in Power Automate)? Or something else?
function main(workbook: ExcelScript.Workbook) {
// ...
let _3__Data_Types_Used = workbook.getWorksheet("3. Data Types Used");
// Delete row 1 on _3__Data_Types_Used
_3__Data_Types_Used.getRange("1:1").delete(ExcelScript.DeleteShiftDirection.up);
// ...
}
Ultimately, I am not committed to any syntax or strategy--I just want to successfully delete Row 1!