Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
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!

  • PowerUnicorn Profile Picture
    9 on at
    Re: Flow can't create a connection with Excel

    I fixed it, so for all others... Here's my fix.  I used Run from Sharepoint and I manually typed in the file name.

    Screenshot 2023-12-12 at 9.20.55 AM.png

    I created a flow that takes a excel email attachment, converts it to have tables, then converts it to CSV then uploads it to an Amazon S3 bucket. I am going to try to put up the whole flow on my tut website drupal girl. Hopefully the next couple weeks. Works busy 🙂

  • PowerUnicorn Profile Picture
    9 on at
    Re: Flow can't create a connection with Excel

    Hi there! When you say "output from 'get file properties' should be used in File in 'run script' action" what field is that? I tried what he did below but no love.
    I used the file name with extension but no could still cannot get it to connect to excel. 😞

     

    PowerUnicorn_0-1701401902342.png

    PowerUnicorn_1-1701401975073.png

     

     



  • Abba Profile Picture
    13 on at
    Re: Flow can't create a connection with Excel

    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

     

  • AS-06081019-0 Profile Picture
    1,736 Super User 2024 Season 1 on at
    Re: Flow can't create a connection with Excel

    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
    Re: Flow can't create a connection with Excel

    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
    Re: Flow can't create a connection with Excel

    Dynamic content used in File in run script?

  • Abba Profile Picture
    13 on at
    Re: Flow can't create a connection with Excel

    Same error 😕

    Abba_0-1657306775624.png

     

  • AS-06081019-0 Profile Picture
    1,736 Super User 2024 Season 1 on at
    Re: Flow can't create a connection with Excel

    @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
    Re: Flow can't create a connection with Excel

    @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
    Re: Flow can't create a connection with Excel

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

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492