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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / excel script Failing t...
Power Automate
Unanswered

excel script Failing to run

(0) ShareShare
ReportReport
Posted on by 2

I am trying to create an automated spreadsheet that adds formulas to columns when I  add a file to a folder.

so for the steps are as follows

convert worksheet to a table - this works

 

I am then running the following Excel script which fails with error

We were unable to run the script. Please try again.
Office JS error: Line 6: Range setFormulaLocal: The argument is invalid or missing or has an incorrect format.
clientRequestId: 1d113969-0826-4412-8af7-41f3b02f7ce2

 

Script

 

function main(workbook: ExcelScript.Workbook) {
let selectedSheet = workbook.getWorksheet("Page 1");
// Set range W1 on selectedSheet
selectedSheet.getRange("W1").setValue("Validate");
// Paste string at cell range W2 on selectedSheet
selectedSheet.getRange("W2").setFormulaLocal("=SUMPRODUCT(([@[Engineer In Date & Time By Agent]]<FILTER([Engineer Out Date &Time By Agent],[Engineer Name]=[@[Engineer Name]]))*([@[Engineer Out Date &Time By Agent]]>FILTER([Engineer In Date & Time By Agent],[Engineer Name]=[@[Engineer Name]])))>1");
}

 

the script works fine when I run it in excel online, but I am unable to get it to work inside Power Automate

Categories:
I have the same question (0)

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard