'Python How to convert .xlsx to .xlsb file

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 ?



Solution 1:[1]

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)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 tuurtje11