Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Use Power Automate to run a script

I have created a script in excel on-line to format a table and other minor configurations and when i run it works perfectly.




When i create a simple flow to run the script it fails every time 😞


The Excel workbook has 5 worksheet and i am only interested in one for this processFlow.JPG

Script Name "CreateTableFourmat" below ..... the name of the sheet i need is "Open Incident Details"


function main(workbook: ExcelScript.Workbook) {
  let selectedSheet = workbook.getWorksheet("Open Incident Details");
  // Delete range 1:1 on open_Incident_Details
  // Create a table with format on range A1:AF9 on open_Incident_Details
  let table1 = workbook.addTable(selectedSheet.getRange("A1:AF9"), true);
  // Rename table table1 to "TbIncident"
  // Set height of row(s) at range 2:9 on open_Incident_Details to 15
Error Details
Start time
Jun 28, 01:48 PM (
2 minutes ago2 min ago
Jun 28, 01:48 PM
Action 'Run_script' failed
Error Details
We were unable to run the script. Please try again.
Workbook not found.
clientRequestId: 8d00f48b-50d9-4511-9987-b64d7ca1c54f
Learn more about Excel Online (Business)/connectors/excelonlinebusiness/
Learn more about Excel Online (Business)
How to fix
To make this flow work, inspect the inputs to this action and ensure they would find the right resource.

Helpful resources

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022- Season 2 has kicked off!

Users online (4,810)