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 / Flow can't create a co...
Power Automate
Unanswered

Flow can't create a connection with Excel

(0) ShareShare
ReportReport
Posted on by 13

I'm trying to create a flow that makes a file based on an email attachment, but the script for the flow isn't running correctly.
Here's the whole flow:

flow1.pngflow2.png

 

And this is the code fore the script if it's relevant:

 

function main(workbook: ExcelScript.Workbook, 
TableName: string = "Table1",
SheetName: string = "Sheet1"
) {
 // Get the worksheet by name
 const selectedSheet = workbook.getWorksheet(SheetName);
 // Create a table using the data range.
 let newTable = workbook.addTable(selectedSheet.getUsedRange(), true);
 newTable.setName(TableName);}

 

 

The error kickback reads: 

We were unable to run the script. Please try again.
The script couldn't create a connection with Excel. Please try again.
clientRequestId: 55e50ca3-4761-4f64-9957-31a80ee13ad5

 

I'm pretty new to this so any help would be appreciated! Thanks!

Categories:
I have the same question (0)
  • AS-06081019-0 Profile Picture
    1,736 Super User 2024 Season 1 on at

    @Abba Please refer this: https://powerusers.microsoft.com/t5/Building-Flows/The-script-couldn-t-create-a-connection-with-Excel/td-p/838665

     

    Hope it helps!!

    Cheers,
    Ankesh
    --------------------------------
    If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

  • Abba Profile Picture
    13 on at

    @ssankesh I saw this solution while looking, but our team Sharepoint doesn't require checking files in or out.

  • AS-06081019-0 Profile Picture
    1,736 Super User 2024 Season 1 on at

    @Abba Try adding a delay before 'run script' action. 

  • Abba Profile Picture
    13 on at

    @Ankesh_49 I tried adding a few different delays up to one minute, but the flow keeps erroring out at the script step after a few seconds.

    Abba_0-1657306024022.png

     

  • AS-06081019-0 Profile Picture
    1,736 Super User 2024 Season 1 on at

    @Abba Could you please try using 'Get file properties' action between 'create file' and 'Run script' and see it it works

  • Abba Profile Picture
    13 on at

    Same error 😕

    Abba_0-1657306775624.png

     

  • AS-06081019-0 Profile Picture
    1,736 Super User 2024 Season 1 on at

    Dynamic content used in File in run script?

  • Abba Profile Picture
    13 on at

    I don't believe so. The flow is creating a new file to run the script in.

  • AS-06081019-0 Profile Picture
    1,736 Super User 2024 Season 1 on at

    No no. What the point I am trying to make is:

    'item id' from create file action should be used in ' get file properties' action and output from 'get file properties' should be used in File in 'run script' action

  • Abba Profile Picture
    13 on at

    Apologies. I tried that, but the flow ended up timing out. However, I didn't have an option for outputs in the run script section so that might have affected the result. Here's how my flow looks now

    Abba_0-1657310711871.png

     

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard