What version of xlrd are you using?
What version of python are you using?
What platform are you running on?
Chris
Hi Jon,
>>> '\x50\x4b'
'PK'
>>>
If you upgrade to the latest version (0.7.0) of xlrd (go to
http://pypi.python.org/pypi/xlrd), you'd get a slightly better error
message:
Unsupported format, or corrupt file: Expected BOF record; found
'PK\x03\x04\x14\x00\x06\x00'
Trivium: 'PK' == initials of Phil Katz, designer of the ZIP file format.
Currently, xlrd supports reading only xls files. What you have is
probably an xlsm file ("Excel 2007 Macro-Enabled Workbook"). These and
xlsx files ("Excel 2007 Workbook") are in a format (XML documents inside
a ZIP file) that's totally different to the format of xls files.
Support for extracting the basic data (no formatting info) from xlsx and
xlsm files is well under way.
Cheers,
John
Well, when you're next near a computer, if yo could find out the exact
version that would help a lot. The only this we're likely to believe is
the output of:
>>> import xlrd
>>> xlrd.__VERSION__
'0.7.0'
As well as that, if you could knock up a really small example
spreadsheet and post it to this list, that would be good.
cheers,
Chris
Where did you get "the latest version of xlrd" from?
Note: the website at http://www.lexicon.net/sjmachin/xlrd has not yet
been updated to supply 0.7.0.
Note: the version number is embedded in the filename of all
downloadables irrespective of version and site.
How did you install it?
Do you possibly have two (or more) different versions of Python on your
computer? Could you have installed xlrd for one version of Python and be
using xlrd with another version of python?
HTH,
John