Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

xlrd Can't find workbook in OLE2 compound document

519 views
Skip to first unread message

Andi Vaganerd

unread,
Sep 17, 2014, 12:28:14 PM9/17/14
to
Hello,

I'm trying to open an excel file (.xlsx) using python module xlrd.
And I'm getting this error over here:

"Can't find workbook in OLE2 compound document"

Is there anybody here already got this problem? How do you resolve it?
I've a very simple python program to open that, but it just doesn't open, here is my very simple code:


============================================
import xlrd

def import_workbook_protected( path ):
wb = xlrd.open_workbook( path )


if __name__ == "__main__":
path = "workbook_for_test.xlsx"
import_workbook_protected( path )
============================================


The only thing differente from others excel files, is that this workbook is protected, not with password, but I can't write on it, just open and read (on my computer, not on python)


Thanks!

dieter

unread,
Sep 18, 2014, 1:54:12 AM9/18/14
to pytho...@python.org
Andi Vaganerd <andi...@gmail.com> writes:
> I'm trying to open an excel file (.xlsx) using python module xlrd.
> And I'm getting this error over here:
>
> "Can't find workbook in OLE2 compound document"

I interprete this message as follows: the excel content in your
file is wrapped in an atypical way (an OLE2 compound document)
and "xlrd" does not fully support this way.

Looking at the "xlrd" source code (searching for "OLE2") may give
you more hints.

> ...
> The only thing differente from others excel files, is that this workbook is protected, not with password, but I can't write on it, just open and read (on my computer, not on python)

Likely, this kind of protection causes excel to choose a special
wrapping, not fully supported by "xlrd".

0 new messages