web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / getUsedRange(); No lon...
Power Automate
Unanswered

getUsedRange(); No longer recognized by power Automate?

(3) ShareShare
ReportReport
Posted on by 35

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.
Categories:
  • ddddd3 Profile Picture
    35 on at

    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 Profile Picture
    35 on at

    ...

  • CDabruck Profile Picture
    34 on at

    I have the same error 😕

  • ddddd3 Profile Picture
    35 on at

    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. 

  • RoRisS Profile Picture
    3 on at

    Hi. Sorry to bump, but did someone figure out the solution yet?

  • WalletPhoneKeys Profile Picture
    13 on at

    Adding a comment for attention.

     

    This needs fixing.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 289

#2
11manish Profile Picture

11manish 288 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 125

Last 30 days Overall leaderboard