I have a short program that collects a list of all .xls files in folder/sub-folders and then I loop through the file list, opening each xls document (Try: book = xlrd.open_workbook(f) ) to look for specific information. If an exception is thrown, I write out the filename to an exception list. What I am finding is that I have a LOT of files that xlrd throws the error :
Traceback (most recent call last):
File "<pyshell#5>", line 1, in <module>
book = xlrd.open_workbook(f)
File "C:\Python32\lib\site-packages\xlrd\__init__.py", line 435, in open_workbook
ragged_rows=ragged_rows,
File "C:\Python32\lib\site-packages\xlrd\book.py", line 116, in open_workbook_xls
bk.parse_globals()
File "C:\Python32\lib\site-packages\xlrd\book.py", line 1206, in parse_globals
self.handle_filepass(data)
File "C:\Python32\lib\site-packages\xlrd\book.py", line 924, in handle_filepass
raise XLRDError("Workbook is encrypted")
xlrd.biffh.XLRDError: Workbook is encrypted
But I can go and open the files with Excel with no problems. Does anyone have an idea as to why xlrd would throw an encrypted error when it doesn't appear that the files are encrypted?
Thanks,
Fred