Search code examples
pythonopenpyxlxlsb

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

  • 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)