Convert xlsb to xlsx - Multi-sheet Microsoft Excel File

0 votes
I have a multi-sheet excel file saved in a .xlsb format that I wish to covert to .xlsx to utilize the openpyxl library - code already written to support the same workbook that used to be .xlsx until macro-enabled, and wouldn't save in .xlsm.

I have managed to convert from .xlsb to .csv, but cannot convert any further and have hit roadblocks with various libraries due to various formatting errors.

As my file has multiple sheets (all tables) I only need to copy and paste the text on every sheet (keeping the sheet names) and get it to a .xlsx format.

For simplicity sake, imagine all I need to do is: get sheet names, access a sheet, determine max row/column, loop: copy and paste cell values, write to .xlsx with sheet name. With the starting file being .xlsb.

Any suggestion would be much appreciated.
Mar 25 in Database by Edureka
• 9,320 points
96 views

1 answer to this question.

0 votes

xlsb can be read by newer versions of Microsoft Office Excel, OpenOffice Calc, or LibreOffice Calc.

So all you have to do now is open the file in one of those programmes and export it to xlsx.

CSV -> xlsx

This can be done easily with pandas, a python package.

import pandas as pd
df = pd.read_csv("/path/to/file.csv")
df.to_excel("/path/to/result.xlsx")


xlsb -> xlsx

Pandas 1.0.0 added the support for binary excel files.

import pandas as pd
df = pd.read_excel("/path/to/file.xlsb", engine="pyxlsb")
df.to_excel("/path/to/result.xlsx")

In order to use it you must upgrade pandas, and install pyxlsb and 'openpyxl':

pip install pandas --upgrade
pip install pyxlsb
answered Mar 30 by Edureka
• 8,820 points

Related Questions In Database

0 votes
0 answers

How to import JSON file to Excel without coding?

Let's say you have a file named input.json which ...READ MORE

Feb 24 in Database by Edureka
• 9,320 points
24 views
0 votes
1 answer

How to read a .xlsx file using the pandas Library in iPython?

Every sheet gets its own DataFrame, which ...READ MORE

answered Mar 25 in Database by anonymous
26 views
0 votes
1 answer

Converting a large XML file to Excel

Using the web URL, import an XML ...READ MORE

answered Mar 24 in Database by Edureka
• 8,820 points
78 views
0 votes
1 answer

Convert numbers to words in Excel (VBA)

In the cell where you wish to ...READ MORE

answered Mar 25 in Database by Edureka
• 8,820 points
37 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 2,760 views
0 votes
1 answer
0 votes
1 answer

Convert a number to a letter in C# for use in Microsoft Excel [duplicate]

If you are familiar with using formulas ...READ MORE

answered Feb 23 in Database by Edureka
• 8,820 points
37 views
0 votes
1 answer

Unable to compress excel file (XLSX or XLS) using java

Because the formats with a 'x' at ...READ MORE

answered Apr 11 in Database by Edureka
• 8,820 points
55 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP