Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Excel File Issue "This workbook couldn't be opened because the file format may not be matching with the file extension."

(0) ShareShare
ReportReport
Posted on by 113 Most Valuable Professional

Hello,

 

I'm having what appears to be a common problem with a flow I inherited without a common solution that I can see.  Using a "When a new email arrives (V3)" trigger, getting the attachment from the email, creating an item in a SP list and then trying to add the email attachment to both SP and OneDrive.  I am using the content bytes value for filling in the file content.

Typically what happens when running is it takes forever and either errors out with a Bad Gateway or it says it works but gives me files with this error: "This workbook couldn't be opened because the file format may not be matching with the file extension.". 

lsheltonSTO1_0-1681133490302.png

lsheltonSTO1_1-1681133659164.png

It's a really simple Excel file, just a few rows and columns of content.  What is going wrong here?  TY in advance!

 

  • Verified answer
    lsheltonSTO1 Profile Picture
    113 Most Valuable Professional on at
    Re: Excel File Issue "This workbook couldn't be opened because the file format may not be matching with the file extension."

    I fixed my own problem - it was the two Apply to Eaches in my case, for some reason.  

    lsheltonSTO1_0-1681137923542.png

    Each reference to file content was just the same thing - items('Apply_to_each')?['contentBytes'] - made sure to reference the trigger, not a later action.  Ran in seconds and the file opens as expected now.

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June 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 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1