You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to python-excel
Hello people.
I have this one excel file full of macros provided for the company
which I work which is not being read by xlrd.
I want to automate the reading, processing and maybe also writing of
this excel file.
I can not edit the macros because it is password protected for the
developer in our company.
This file has also cells which are "protected" and doesnt allows me to
edit them, but only through some others non-protected.
If I try to load it directly, I get this result:
NOTE *** Ignoring non-worksheet data named u'Macros' (type 0x06 =
Visual Basic module)
Traceback (most recent call last):
File "C:\Users\Administrador\Desktop\Test Testsight\ict2pdf
\ict2pdf.py", line 18, in <module>
xlBook = xlrd.open_workbook(xlFilename)
File "C:\Python27\lib\site-packages\xlrd\__init__.py", line 481, in
open_workbook
bk.get_sheets()
File "C:\Python27\lib\site-packages\xlrd\__init__.py", line 1067, in
get_sheets
self.get_sheet(sheetno)
File "C:\Python27\lib\site-packages\xlrd\__init__.py", line 1058, in
get_sheet
sh.read(self)
File "C:\Python27\lib\site-packages\xlrd\sheet.py", line 1082, in
read
saved_obj = self.handle_obj(data)
File "C:\Python27\lib\site-packages\xlrd\sheet.py", line 1888, in
handle_obj
assert pos == data_len
AssertionError
Process completed, Exit Code 1.
Execution time: 00:00.679
If I then open it with LibreOffice and save it as .xls (97/2000/xp),
then I do can read the contents.
I don't understand why is failing.
What can I do to help you to discover this without sending the excel
file which is copyrighted.
Cheers
Diego
John Machin
unread,
Jun 3, 2012, 7:41:04 PM6/3/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to python...@googlegroups.com
On Saturday, June 2, 2012 12:10:55 PM UTC+10, Diego J. wrote:
File "C:\Python27\lib\site-packages\xlrd\sheet.py", line 1888, in
handle_obj
assert pos == data_len
AssertionError
It's rather difficult and tedious to attempt debugging a problem like that without direct access to a copy of the file. I have just now committed a fix to a probably-related problem -- see https://github.com/python-excel/xlrd ... I suggest that you get a copy of that and try it out and tell me the result.
By the way, "copyright" doesn't mean "can't let people read it" (otherwise the new book trade couldn't exist). Please consider to your boss about an NDA (non-disclosure agreement).
Diego Jacobi
unread,
Jun 4, 2012, 8:53:52 PM6/4/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to python...@googlegroups.com
Genius !
You had it !
I have downloaded todays version from github.
File named as python-excel-xlrd-0.7.6-15-gdf92535.zip
Installed it in windows and it worked with the original .xls file.
The only difference that I see is this warning:
"NOTE *** Ignoring non-worksheet data named u'Macros' (type 0x06 =
Visual Basic module)"
Which is harmless, as long as the Macros doesn't get edited.