logo
search
File Format & Compatibility

Fix Power Automate Unrecognized Excel File Extension Error

Partner EditorPartner Editor Oct 1, 2026 868 views

Question details

The user needs to resolve an intermittent error in Power Automate where an Excel file's format or extension is not recognized when attempting to run an Office Script.

How to Fix Power Automate Unrecognized Excel File Extension Errors
Product
Power Automate & Microsoft Excel
Device & OS
not provided
Scenario
Running an Office Script on a SharePoint Excel file via a Power Automate flow.
Observed behavior
The flow intermittently fails, reporting that the file format or extension is not valid or unrecognized by the system.
Before you start

Ensure that the target Excel file is saved in the .xlsx format, as older formats like .xls are not supported by Office Scripts in Power Automate.

Solution 1Recommended

Use Dynamic File Identifiers and Extension Checks

Prevent extension errors by configuring the flow to verify the .xlsx format and using dynamic file identifiers instead of hardcoded file names.

When a Power Automate trigger receives multiple file types from a SharePoint folder, it may attempt to run an Excel-specific Office Script on non-Excel files. By filtering for the correct extension and dynamically targeting the file's unique identifier, you can eliminate format recognition errors.

1
Add a file extension condition

Before the 'Run script' action, insert a 'Condition' control. Set it to check if the incoming file name ends with '.xlsx' to ensure the script only triggers for valid Excel files.

2
Use dynamic file identifiers

In the 'Run script' action, click on the File parameter field. Instead of typing a fixed name like Book.xlsx, select the dynamic '{identifier}' token from the dynamic content menu.

3
Configure Compose action in loops

If your flow processes multiple files inside an 'Apply to each' loop, use a 'Compose' action. Enter the expression items('Apply_to_each')?['{identifier}'] to safely reference the dynamic file identifier.

4
Remove unnecessary loops

If your flow is designed to only process a single file per trigger, drag your actions outside the 'Apply to each' block and delete the loop. This simplifies the flow and reduces variable reference errors.

Use Dynamic File Identifiers and Extension Checks
Extracting File Extensions: You can use a Compose action with an expression to isolate and test the file extension before passing it to your condition block.
Free Microsoft Office alternative

Need a Lightweight Alternative for Your Spreadsheets? Try WPS Office

If you frequently manage spreadsheets and are looking for a fast, reliable, and completely free alternative to Microsoft Office, WPS Office is an excellent choice. It offers seamless format compatibility and a familiar interface for smooth workflow transitions.

Fully compatible with Microsoft Excel formats including .xlsx, .xls, and .csv.Lightweight installation that runs smoothly on most devices without lagging.Familiar user interface requiring zero learning curve for Office users.Built-in tabbed viewing for managing multiple spreadsheets in a single window easily.
microsoft office alternative - wps office

Frequently Asked Questions

Why does Power Automate say my Excel file extension is not valid?

This usually happens if the file parameter in your 'Run script' action uses a static name that doesn't match the dynamically changing file, or if the flow encounters a non-Excel file (like .doc or .ppt) in the same SharePoint folder without filtering it first.

Can I run Office Scripts on older .xls files in Power Automate?

No, Office Scripts only support modern Excel file formats like .xlsx and .xlsm. You must convert older .xls files to .xlsx before attempting to run an Office Script on them.

How do I extract the file extension in a Power Automate flow?

You can use an expression in a Compose action, such as last(split(triggerOutputs()?['body/{FilenameWithExtension}'], '.')), to extract just the file extension for your condition checks.