Whenever i run the code below I get the following error:

AttributeError: 'Book' object has no attribute 'on_demand'
WARNING: Failure executing file: <copy.py>

Why is it so??

from xlrd import open_workbook
from xlwt import easyxf
from xlutils.copy import copy
rb =  open_workbook('source.xls',formatting_info=True)
rs =  rb.sheet_by_index(0)
wb =  copy(rb)
ws =  wb.get_sheet(0)
plain = easyxf('')
for i,cell in enumerate(rs.col(2)):
     if not i:
         continue
     ws.write(i,2,cell.value,plain)
for i,cell in enumerate(rs.col(4)):
     if not i:
         continue
     ws.write(i,4,cell.value-1000)
wb.save('output.xls')

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to