Skip to main content

Notifications

Community site session details

Community site session details

Session Id : RMjmj+dDhwHHESzOEUMFKO
Power Automate - Building Flows
Unanswered

Corrupted xlsx file when save on One Drive

Like (2) ShareShare
ReportReport
Posted on 13 Mar 2024 14:49:52 by 2

Hello, 

 

I have set up a very simple flow using power automate which is designed to download an excel document from an email attachment and save it into a one drive folder. 

 

The flow is able to recognise the email attachment as an xlsx file and saves it to the one drive in this format however,  when I try to open the file I am met with the error that reads  'Excel cannot open the file 'FileName.xlsx' because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file'.

 

I have tried a number of different things including different files, different emails, changing the file name etc. but nothing seems to make a difference as I always come up against this error. 

 

Has anyone experienced something like this before?

 

I've attached a few images to help explain my point. 

  • creativeopinion Profile Picture
    10,406 Super User 2025 Season 1 on 13 Mar 2024 at 16:38:28
    Re: Corrupted xlsx file when save on One Drive

    @theor First, I would recommend using the Classic Designer. Since you've already started editing your flow in the New Designer—I'd recommend creating a brand new flow and starting from scratch. Ensure you use the Classic Designer before you continue editing. The New Designer is still pretty buggy. 

     

    You might find this YT Tutorial helpful: Save Email Attachments to SharePoint with Microsoft Power Automate

     

    Although, I cover how to get your email attachments from Outlook to SharePoint, the same concepts can be applied when creating files in OneDrive.

     

    Power Automate doesn’t have a download attachment from outlook action. In this Power Automate Video tutorial, I’ll show you how to use the Get Attachment (V2) action in combination with the Create File action to get your email attachments onto SharePoint. The Create File action will overwrite any files that already exist with the same name. In this tutorial, I’ll show you how you can append a timestamp to the end of a file name to prevent your file from being overwritten.

     

    I’ll also show you how to set up your flow so that you can trigger it manually while building it so you don’t need to wait for an email to arrive. At the end of the video I’ll show you how adding trigger conditions to your flow can prevent it from triggering if certain conditions aren’t met. Although the final flow uses the When a new email arrives in a shared mailbox (V2) trigger, you can use any of the When a new email arrives triggers for your flow. Adjust this flow to suit your needs!

     

    IN THIS VIDEO:

    âś… How to Automate Downloading and Uploading Email Attachments to SharePoint

    âś… How to Use a the Get Email (V2) action

    âś… How to Use the Get Attachment (V2) action

    âś… How to Create Attachment Files using the Create File Action

    âś… How to Prevent the Create File Action from Overwriting a File

    âś… How to use Split the Filename from its Extension

    âś… How to Append a Timestamp to a File Name

    âś… How to use the When a New Email Arrives in a Shared Mailbox (V2) trigger.

    âś… How to use the Convert Time Zone action

    âś… How to add Trigger Conditions to your Flow

     

    Hope this helps!


    If I helped you solve your problem—please mark my post as a solution ✅.
    Consider giving me a 👍 if you liked my response! 

    👉 Watch my tutorials on YouTube
    👉 Tips and Tricks on TikTok
     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

#1
stampcoin Profile Picture

stampcoin 61

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 47 Super User 2025 Season 1

#3
rzaneti Profile Picture

rzaneti 31 Super User 2025 Season 1

Overall leaderboard
Loading started