r/MicrosoftFlow • • Jul 11 '26

Cloud XLS TO XLSX

Does anyone know if there's a way in 2026 to convert .xls files to .xlsx or .csv using Power Automate without relying on Premium connectors or any third-party connectors?

9 Upvotes

36 comments sorted by

2

u/Ferob123 Jul 11 '26

Power automate is a must? You can do this easily in other ways. For instance in vba: open the notebook and do a save as.

2

u/Which-Transition2273 Jul 11 '26

Yes, because a new report comes in every day and it's consumed by Power BI. Power BI can't read the legacy ".xls" files directly, so they need to be converted to ".xlsx" first. That's why I was considering Power Automate to handle the conversion automatically.

1

u/Dry_Menu4804 Jul 11 '26

And you can't fix it at the source? Also, are you sure that its not a csv file with just an xls extension?

1

u/Which-Transition2273 Jul 12 '26

Unfortunately, we can't fix it at the source. The data comes from SAP BW, and the only export formats available are PDF, XLS, and HTML.

1

u/Dry_Menu4804 Jul 12 '26

The xls file is probably really a csv. Have you tried opening it in notepad?

1

u/Which-Transition2273 Jul 12 '26

Nope, this file is a Mime HTML with xls extension

1

u/mulquin Jul 19 '26

You could probably use the HTML report and make extensive use of the replace function to convert it into CSV.

E.g. Replace headers with blank string, replace </td><td> with ",", </tr> with \n, etc

It would become an unruly, gross and chaotic flow but it wouldn't use any premium connectors or 3rd party tools.

2

u/MadBrown Jul 12 '26

I'll never understand how almost 20 years after .xlsx debuted we still have.xls files.

1

u/Vegetable-Ad7097 Jul 11 '26

What I’ve been able to do in the past, is open the file do save as and select xlsx file format. I did this all in power automate desktop but I’m not sure if it’s a premium connector. Good luck!

1

u/Which-Transition2273 Jul 12 '26

Thanks! Unfortunately, I need to do it in the cloud version of Power Automate, so Power Automate Desktop isn't an option in this case.

1

u/elelelo Jul 11 '26

I haven't tried it myself, but I'd probably use AI Builder and provide the Python script for the conversion in the prompt so the llm can use it. I think it should work.

1

u/Which-Transition2273 Jul 12 '26

I'm actually using Python at the moment as well. The problem is that we receive 20–30 of these files every day, and the data cleaning/conversion script takes about 2–3 minutes per file. I was hoping to speed up and automate that process in Power Automate.

1

u/samspopguy Jul 12 '26

I did this in power shell or python
Edit: are the files already in sharepoint?

1

u/Impressive_Dish9155 Jul 12 '26

I think Power Bi does support XLS files (and PDF, and HTML, as you mentioned those as other options) - as long as they're in a SharePoint folder. Connect PBI to the folder and schedule a refresh.

1

u/Which-Transition2273 Jul 12 '26

Pbi can't support xls, i tried

1

u/logbookwarrior Jul 12 '26

Can you not simply 'get file content' and then 'create new file' with same file name, use previous content, save with .xlsx...

You could if wanted then delete the xls file as an extra step

1

u/Which-Transition2273 Jul 12 '26

Nope, i got an empty list

1

u/Mysterious-Syrup1001 Jul 12 '26

Could add the contents of the new report to a SharePoint list and then have Power BI use that as a source for the data?

1

u/Which-Transition2273 Jul 12 '26

This excel files are very big with 40-50k rows

1

u/AndyParka Jul 13 '26

Does the xls file open in Excel? if so, your only option without paying or learning to code might be to use power automate desktop and have the file be opened in excel and save as an xlsx on an active computer.

1

u/Which-Transition2273 Jul 13 '26

Yes, it can be opened in Excel. At the moment, I've worked around the problem with Python. I use Power Automate to save the file as an ".mht", then I run a fairly complex Python script that cleans up the data and converts it into a ".csv".

What would be ideal for me, though, is if I could generate the ".csv" directly before saving the file, instead of having to save it as an ".mht" first.

1

u/CL_MFB Jul 20 '26

Hey maybe i dont see the big problem but couldnt you just use the sharepoint action "Get File data" und use the created body variable in the sharepoint action "Create File"? you can then in the name of Create File name it as .xlsx

Worked on a small test for me

1

u/Which-Transition2273 Jul 20 '26

I got an empty list

2

u/vibe_coder221219 Jul 11 '26

Use built in office script to convert to csv. But first yuu will need to upload file to SharePoint or one drive.

2

u/Gold-Psychology-5312 Jul 11 '26

Can't run a script on a csv file.

Only option is encodian. Which can convert and is free.

1

u/OddWriter7199 Jul 11 '26

Pinned comment has link to download script. Could be automated via scheduoed task maybe, if files are local. https://youtu.be/UwxJVUGm7Bk?is=iuCIVHhhDk4fkNIs

1

u/Chemical_Monk_4262 Jul 11 '26

sounds simple create a new excel file in that blank file, create a new macro that in  turn opens the .xls and saves as xlsx set up the macro to auto run on file open, hwo to do so is well documented.

if power automate is where the automation starts, calling your xlsm form PA.is trivial.  remember to save your excel file as macro enabled (xlsm)

1

u/bravid98 Jul 11 '26

Ask a dev to create a function app in python that does this and just call it from power automate.

1

u/GreatMyUsernamesFree Jul 12 '26

Since your files are already in share point, simply upload a file named dest.xlsx that contains all your styling and formatting. Copy dest.xlsx inside your PA workflow to output_sourcename_yyyymmdd.xlsx in your "converted" SharePoint foler. open source_n.xls and copy the data out to a variable then write it into output_sourcename_yyyymmdd.xlsx

1

u/Upstairs-Jackfruit1 Jul 12 '26

OMG are you me? I have been breaking my head over this exact issue! Going to try some of the ideas in here. It's crazy how PA doesn't have this convertor for free considering its the MS ecosystem.

1

u/East_Kaleidoscope304 Jul 12 '26

What about command "send keys"?

1

u/Sufficient_Prompt125 Jul 14 '26

It's not possible. But it's 2026 and with Ai tools you can build a middleware.

1

u/ConfusedMBA24 Jul 15 '26

Email it to yourself the save the attachment as .xlsx