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 / We were unable to run ...
Power Automate
Answered

We were unable to run the script. Please try again.

(0) ShareShare
ReportReport
Posted on by 5

I'm currently struggling with the below error code in Power Automate.

 

We were unable to run the script. Please try again.
Office JS error: Line 8: {"message":"code":"InvalidArgument","type":"Worksheet","method":"getRange","line":8}
clientRequestId: 53f4345c-6629-4eef-a2aa-76fc5aa0b748

 

 

I made a flow that automatically filled an Excel sheet in a shared folder based on the reply of a survey in Forms.

To fill the sheet, I use a script file and it's like below.

I tried to fix but I still don't know what's wrong with this code.

 

 

function main(
workbook: ExcelScript.Workbook,
sheetName: string,
cellAddress: string,
updateValue: string
) {
let sheet = workbook.getWorksheet(sheetName);
let updateCell = sheet.getRange(cellAddress).setValue(updateValue);
let cellValue = sheet.getRange(cellAddress).getValue();
return cellValue;
}
 
 David999_0-1708408183431.png
Categories:
I have the same question (0)
  • v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi , @David999 

    Your office script seems has no error. Your error code means that you pass the invalid cellAddress in the getRange() function.

    Can you check what the value you pass to the Office script in the flow?

     

    Best Regards,

    Yueyun Zhang

  • David999 Profile Picture
    5 on at

    Thank you for your reply. I double-checked what values are delivered to each cell but there's nothing strange. I think it could be a kind of temporary bug(?) since this error doesn't always happen.

  • Verified answer
    v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi , @David999 

    If you can run it successfully, but the error has occurred a few times, then it is indeed possible that it is a temporary error, because your code really doesn't look like a problem, if the pass value doesn't change.

     

    Best Regards,

    Yueyun Zhang

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 460

#2
Vish WR Profile Picture

Vish WR 343

#3
David_MA Profile Picture

David_MA 249 Super User 2026 Season 1

Last 30 days Overall leaderboard