Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

Error The file is corrupt and cannot be opened > Using flow sending outlook email with attachment of a excel macro file from SharePoint/folder

(0) ShareShare
ReportReport
Posted on by 12

My requirement is - To send a macro file as outlook attachment with some dynamic data from SharePoint/folder/macro file.
I am reading a excel/macro file  from a SharePoint/folder/macro file then adding some rows.
After that I kept 10Sec delay.
Now I am reading the file metadata (using the path, and this I am getting from power app) and file content. And apend that to a array. Then I am sending email to someone.
File is sent successful to the outlook. But while opening that email attachments of this file. An error comes and it says "The file is corrupt and cannot be opened" .
But if I will open same file in SharePoint, it gets open perfectly and I can see newly added data by this flow.

Could you help me here to fix this.

 

BPP_P_0-1655383054914.png

error on the excel file --

BPP_P_1-1655383442958.png

after clicking yes, it says below

BPP_P_2-1655383512965.png

 

  • Verified answer
    BPP_P Profile Picture
    12 on at
    Re: Error The file is corrupt and cannot be opened > Using flow sending outlook email with attachment of a excel macro file from SharePoint/folder

    Now I have fixed this by removing  double quotes around the contentbytes inside the Append to Array variable in my above steps.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,645 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow