cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ddddd3
Regular Visitor

getUsedRange(); No longer recognized by power Automate?

Hey everyone!
I have a flow built which runs a series of ExcelScripts. It has been running fine for the past 4-5 weeks.
Initially, when i went to re-read the ExcelScript - It decided that "ExcelScript" wasn't a valid namespace? Even though my usage of it is a direct copy of the examples provided. This caused around 2-3 Hours of unnecessary debugging, afterwards simply selecting everything - Cut'ing - then Paste'ing - And a final re-save of the script sorted that out. However...

Today it failed, and it failed on a step that is unchanged in the script;
We were unable to run the script. Please try again.
Runtime error: Line 4: Cannot read property 'getUsedRange' of undefined

The line in question is here from the ExcelScript in question;

let selectedSheet = workbook.getWorksheet("src_people");
let usedRange = selectedSheet.getUsedRange();

Running this script manually with some dummy data works fine, the getUsedRange(); runs as expected and the data returned is correct. However - ONLY in this past week - power Automate decided selectSheet is undefined?... There is zero information on this from what I could find between here/stack overflow/reddit etc.

The sheet is named "src_people", I have checked and confirmed this (It runs manually). 
I have tried selectedSheet.getUsedRange(true); , Nothing changed, same error.
I have tried workbook.getWorksheet("src_people").getUsedRange();, Nothing changed, same error.
I have tried workbook.getActiveWorksheet().getUsedRange();, Nothing changed, same error.

I'm of the opinion I shouldn't have to change ANYTHING, as this flow has run fine - unchanged - for 4-5 weeks.

E* If there was an update behind the scenes id love to be pointed to where I can monitor these changes. Its expected that things develop but not at the cost of existing function.
4 REPLIES 4
ddddd3
Regular Visitor

Small Update (still unresolved)

Curiously around an hour or so after posting this, the flow decided to trigger itself 6 times over the course of 2 hours. This is a flow triggered by a specific email subject and I did not receive additional emails to trigger this. Of those 6 triggers, 1 of them managed to succeed.... With no changes to the script or context outlined above. The 1 successful trigger was the 4th one, with 2 following runs failing for the same reasons outlined above.

ddddd3
Regular Visitor

...

CDabruck
Frequent Visitor

I have the same error 😕

Sorry bud! We got a third party to develop us a solution outside of this issue avoiding the MS Platform entirely. Impossible to get any support so i would suggest trying to find options outside of the platform.

Capturing the Excel file locally as CSV and using something like https://docs.python.org/3/library/csv.html To parse and progress your automation. 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (2,874)