I am trying to modify Excel files using Python, but I can't get the xlutils
package to work correctly. When I try an example (from this thread):
from xlutils.copy import copy
w = copy('book1.xls')
w.get_sheet(0).write(0,0,"foo")
w.save('book2.xls')
I get the following result:
Traceback (most recent call last):
File "names3.py", line 2, in <module>
w = copy('names.xls')
File "C:\Program Files (x86)\Python27\lib\site-package
g\xlutils\copy.py", line 19, in copy
w
File "C:\Program Files (x86)\Python27\lib\site-package
g\xlutils\filter.py", line 937, in process
reader(chain[0])
File "C:\Program Files (x86)\Python27\lib\site-package
g\xlutils\filter.py", line 61, in __call__
filter.workbook(workbook,filename)
File "C:\Program Files (x86)\Python27\lib\site-package
g\xlutils\filter.py", line 287, in workbook
self.wtbook.dates_1904 = rdbook.datemode
AttributeError: 'str' object has no attribute 'datemode'
I can barely find any information about this error, I would really appreciate any help! Thanks