Python How to convert .xlsx to .xlsb file

3.1k Views Asked by At

I need to convert some XLSX files to XLSB.

Before doing this I open each xlsx file with openpyxl (openpyxl to keep the data frame style).

Do you have a solution to convert it directly by openpyxl or by a python script ?

1

There are 1 best solutions below

3
On BEST ANSWER

You can convert an xlsx file to xlsb with this package: https://github.com/gibz104/xlsb-converter You can convert all the xlsx files in a folder:

path = test.xlsx
main(path)

Or you can convert a specific file with this:

fileList = [test.xlsx]
convertFiles(fileList)