Problem opening xlsx files

3,306 views
Skip to first unread message

gruenkohl

unread,
Mar 7, 2011, 7:20:33 AM3/7/11
to openpyxl-users
Hello and thanks for the code. I'm kind of new to all this (python)
and already had problems installing openpyxl on winXP. Now I just
copied the data folder to the python/Lib. It seems that I can use the
code but when I try to open a xlsx-file with load_workbook I get this:

openpyxl.shared.exc.InvalidFileException: File is not a zip file

Also I'm not able to open the test file with winzip. Suggestions?


Eric Gazoni

unread,
Mar 7, 2011, 7:53:59 AM3/7/11
to openpyx...@googlegroups.com
Hi,
I'm afraid your Excel file is not a valid .xlsx file. Can you open it
with Excel in the first place ? Are you sure it's using the XLSX file
format and not the old XLS file format ?

Cheers,
Eric

Le 7/03/11 13:20, gruenkohl a �crit :

gruenkohl

unread,
Mar 7, 2011, 10:56:34 AM3/7/11
to openpyxl-users
Hi and thanks for the quick reply...
I have to deal with a bunch of xlsx files. Opening and working with
excel works fine. Just copied one of those and got the error. I now
created an excel sheet and saved it as a xlsx file. Your software
worked fine for that one. So I have to find out about the formating of
my other files. Maybe its xls, but why the xlsx-ending?

Eric Gazoni

unread,
Mar 7, 2011, 10:59:41 AM3/7/11
to openpyx...@googlegroups.com
Just to be sure, is OpenOffice OCalc involved in the
creation/manipulation of those workbooks at any time ?
There are reports of incompatibility between openpyxl and
LibreOffice/OpenOffice.

Le 7/03/11 16:56, gruenkohl a �crit :

gruenkohl

unread,
Mar 7, 2011, 11:13:27 AM3/7/11
to openpyxl-users
xlrd package is not working for my files...

gruenkohl

unread,
Mar 7, 2011, 11:14:14 AM3/7/11
to openpyxl-users
OO is not involved as far as I know

Eric Gazoni

unread,
Mar 7, 2011, 11:15:53 AM3/7/11
to openpyx...@googlegroups.com
Well, if the content of the workbooks is not confidential, could you
create a ticket on the bugtracker, and attach one buggy workbook to the
issue, so I can inspect it and tell you what's going on ?

Le 7/03/11 17:14, gruenkohl a �crit :

gruenkohl

unread,
Mar 7, 2011, 11:45:38 AM3/7/11
to openpyxl-users
Thanks, thats a lot of help. I have to see these days, if I can
publish one of the files.

gruenkohl

unread,
Mar 9, 2011, 11:32:59 AM3/9/11
to openpyxl-users
Ok. Worksheets in the file are password protected. This might be the
reason. Is there an easy solution for that?

Eric Gazoni

unread,
Mar 9, 2011, 3:28:56 PM3/9/11
to openpyx...@googlegroups.com
There is some basic support for password protection, but it doesn't
fully work as far as I know.
To fix that, someone needs to go through all places where data are
encrypted in a password protected workbook, and add the decoding
function (and you can have several layers of protection on top of that).
That's a bit of work actually, not long, but could be tricky, and no
quick fix unfortunately (except opening the workbooks, unlocking the
worksheets with the right password, and saving them as unencrypted ...)

Le 9/03/11 17:32, gruenkohl a �crit :

Reply all
Reply to author
Forward
0 new messages