Skip to main content

Notifications

Power Automate - Using Connectors
Unanswered

Excel script failing intermittently when run from Power Automate

(0) ShareShare
ReportReport
Posted on by

I have a flow which takes updates from an excel sheet (which has a data connection updating on a schedule) and uploads them to SharePoint. At the end of the flow I call an excel script which copies the table from one sheet to another, in order to drive the formulas in the 'Status' column (basically when the two sheets match the status is "Same", when new data comes into the data table the status will be "Update" if it is different or "New" if it is not found). The table is ~9670 rows.

 

I have never had any issues running it in Excel, but occasionally it will fail in Power Automate. It has run fine over the past few days (running every 15 mins) but then today it failed 5/10 times in the last few hours. 

 

Here is my script:

 

 

function main(workbook: ExcelScript.Workbook) {
 
let compareSht=workbook.getWorksheet("Existing")
let rosterTbl = workbook.getTable("RosterTbl");
let RosterTblSht=workbook.getWorksheet("RosterTbl")
let lastRow = RosterTblSht.getUsedRange().getRowCount()
let lastCol = RosterTblSht.getUsedRange().getColumnCount()
 let testCol: ExcelScript.RangeView = rosterTbl.getRangeBetweenHeaderAndTotal().getVisibleView()

compareSht.getRangeByIndexes(1,0,20000,15).clear()

compareSht.getCell(1, 0).copyFrom(RosterTblSht.getRangeByIndexes(1,0,lastRow+1,lastCol), ExcelScript.RangeCopyType.all,false,false)

 

 

 

 The error I see more often is:

 

 

We were unable to run the script. Please try again.
Office JS error: Line 13: Range copyFrom: The request is aborted.
clientRequestId: 46a880d9-3443-4823-aa1c-9b893e1f0859

 

 

 

Occasionally it has fails with

 

 

We were unable to run the script. Please try again.
Your file was not saved because we could not merge your changes with changes from someone else.
clientRequestId: 99cd4341-4a43-41c0-9fba-7c692b2f5fdf

 

 

 

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,434

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,722

Leaderboard

Featured topics