How to Convert Excel XLS to XLSX in Power Automate

Cloudmersive
4 min read3 days ago

--

Even now, nearly 20 years after the introduction of Excel Open XML (XLSX) format, it’s still common to find Excel XLS (97–03) spreadsheets lying around — particularly on legacy systems.

Modernizing XLS files means either 1) exporting XLS documents as XLSX manually, or 2) programmatically converting XLS files to XLSX en masse. Thanks to Power Automate, we can easily accomplish the latter without writing a line of code. We can source XLS files directly from one folder, leverage a document conversion action to convert those files to XLSX in our flow, and then save the modernized files in a separate folder where they’ll be accessible to business users.

In this article, we’ll walk through an easy solution for converting XLS to XLSX in Power Automate. We’ll demonstrate this in the context of a manually triggered, instant cloud flow so we can have full control over our data.

In my example flow, I’ll be converting a folder containing four Excel XLS (97–03) workbooks to XLSX format.

We’ll begin our flow with an action that retrieves file IDs and other metadata from our Excel XLS file folder. In this case, we’ll use the List folder action from the SharePoint connector.

Next, we’ll add a Get file content action from the SharePoint connector. We’ll use the file ID (Id) value from our List folder action to bring the Excel XLS file bytes into our flow. Since we’re asking our Get file content action to deal with multiple XLS inputs, Power Automate will automatically wrap the action in a For each control.

We’ll now add our XLS to XLSX conversion action within the For each control. To find this action, we’ll search “Cloudmersive” in the connector search bar and look for the Cloudmersive Document Conversion connector with the green logo.

We’ll click “See more” to view the actions list, and from there, we’ll CTRL+F search for an action called Convert Excel XLS (97–03) Spreadsheet to XLSX, and we’ll select it once we find it.

If it’s our first time using this connector, we’ll need to create our connection before we can begin configuring our request. To authorize our API calls, we’ll need a free API key, and we can get one by creating a free account on the Cloudmersive website. Free API keys allow a limit of 800 API calls per month with zero commitments.

To configure our request, we’ll simply add our file bytes and file names (retrieved by our Get file content and List folder actions respectively) in each of our two request parameters.

In the final step of our flow, we’ll add a Create file action within the For each control, and we’ll write the resulting file bytes to new XLSX files.

In my example flow, I’m saving my new XLSX files in a separate folder from the original, and I’m reusing the names from the original files without the original .xls extensions (to remove the .xls extensions, I’m using Power Automate’s Slice function; this allows me to return a portion of the file name string by index).

After we save and run our flow, we’ll find our converted documents the folder we specified.

And that’s all we need to do!

Just like that, we’ve updated an entire folder full of XLS documents to XLSX format. If we’re interested in “setting and forgetting” this workflow, we could easily create an automated version of this flow that runs any time XLS files enter our target folder.

--

--

Cloudmersive

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.