XLRDError: Expected BOF record; found 0x4b50

calendar_today Asked May 25, 2012
thumb_up 7 upvotes
history Updated April 16, 2026

Question posted 2012 · +6 upvotes

I don’t think there is something wrong with the codes. Can you help me? I need help. Thank you!

from xlrd import open_workbook

wb = open_workbook('/pdf-ex/exc.xlsx','rb')
for s in wb.sheets():
    print 'Sheet:',s.name
    for row in range(s.nrows):
        values=[]
        for col in range(s.ncols):
            values.append(s.cell(row,col).value)
        print ",".join(values)
    print

Accepted answer +7 upvotes

I had the same problem and resolved it by upgrading to version 0.8.0.

Prior to that version, xlsx/xlsm were not supported.

Release announcement: http://mail.python.org/pipermail/python-list/2012-August/627757.html

Latest version: https://pypi.python.org/pypi/xlrd/

External references cited (2)

Top excel Q&A (6)

+7 upvotes ranks this answer #122 out of 167 excel solutions on this site .