web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Error saying The file ...
Power Automate
Answered

Error saying The file format is not recognized. Please check that the selected workbook is valid. clientRequestId: 01a02033-06a8-4a5a-909c-e9b7fbc45436

(0) ShareShare
ReportReport
Posted on by 12

Hi,

I have this problem where I run a flow and every time when it suppose run a script I get error just like in the title. I try that on different files and it was the same error every time. I went in to file properties and change so it can be open by everyone. The flow is simple whenever I got email with attachments create file out of that attachment then copy data from excel and paste it in to another excel. I try to find solution online but it didn't help and don't know what to do. Please can someone help me?

PR6_0-1711379834572.png PR6_1-1711379870669.png

 

 

Categories:
  • Manish Solanki Profile Picture
    15,169 Moderator on at

    Hi @PR6 

     

    Pls make sure that attachments from email are excel files. For that, you could add "Condition" action to check the file extension. Additionally, you could switch to classic designer as new designer does not work properly when dealing with binary or base64 data for creating file. To make sure that script is working properly, you can hard code the file path and test the office script.

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

  • PR6 Profile Picture
    12 on at

    Hi, 

    Thanks for your comment I did like you said but that didn't helped and I think I might did something wrong with condition step. I added as second step 

    PR6_1-1711448524188.pngPR6_2-1711448555671.png

    as you can see. But that didn't helped I got the same error on run script part but this time I also another one on condition part but when I try to send file that wasn't excel it worked 

    PR6_0-1711448453757.png

    but when I try to send file that wasn't excel it worked 

    PR6_3-1711449203585.png

    when it comes to hard coding the path it worked but that solution won't be possible because the name of the file in email will be different every time when it will be sent and that's why I have to use dynamic reference so that the run script step looks for a file by the name of the email attachment

     

     

  • Verified answer
    Manish Solanki Profile Picture
    15,169 Moderator on at

    Hi @PR6 

     

    Pls pass the id of the file from the create file action in onedrive:

    ManishSolanki_0-1711450118809.png

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

  • PR6 Profile Picture
    12 on at

    Hi,

     

    I did some test on hard coding the path and it worked fine I had success every time but first I had to remove the file that was saved as attachment form the folder in which it was saved but this only needed to be done for the file with the same name.

    I did as you told me replaced name of the file with the ID of the saves attachment from the folder in wchic it was saved to but the flow was stuck in for each. Whole flow run for 13 minutes.

    PR6_0-1711456184077.png

    and then I got error in last part on the script with message

    "We were unable to run the script. Please try again.\nOffice JS error: Line 11: Range clear: The request failed 
    with status code of 404.\r\nclientRequestId: 4d6f38aa-7693-41f7-8805-5aef0bbc489d",
          "logs": []
    But that's part on vba code.
     
    So I think that thanks to you flow is working. Let me test it few more times and made corection to VBA code before I mark this as solved 

     

  • PR6 Profile Picture
    12 on at

    Dear @ManishSolanki  Can you help me with two issues that cause the flow not to work properly, i.e. the VBA code and is there any way to shorten the flow duration? Or should I start a new thread?

  • curiousperson Profile Picture
    4 on at

    hi all im facing the same issue but providing the id doesn't resolve the issue. also tried using create file instead of copy file but that didnt work either

  • prashantch Profile Picture
    4 on at

    Hi everyone,

    I encountered a similar issue when calling the Office script, but I was able to resolve it.
    Here are some possible solutions that might help you:

    1. Add a format check condition before calling the script within flow.
    2. Include a delay: If you are creating the file within the flow and then running the script, consider adding a delay or another connector to ensure the file is ready for consumption.
    3. Parameter passing: If you are passing parameters via environment/global/local variables, make sure you are passing the correct document drive ID (the library name/ID could be the issue) into your script running action.
    4. Run the script in a separate flow: Try running your script in another flow and then call that flow from your main flow using the "Run a Child Flow" action, which can be used to run any instant/button-triggered flow present in the same solution as your parent flow.
    5. Check the File Manually: Manually check the file whether it is opening well or not, sometimes file can be corrupted.
    6. Check the script on a OneDrive file: As a last option, try running your script on a OneDrive file.

    These are the findings that helped me solve script calling issues in Power Automate.

    Thanks!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 298 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 289

#3
Henil Profile Picture

Henil 125

Last 30 days Overall leaderboard