Updating existing excel files with header and footer.

140 views
Skip to first unread message

fractaldsgns

unread,
May 28, 2018, 2:51:59 AM5/28/18
to python-excel
Hello everyone,

I have a small problem modifying existing "xls" files with header/footer (see screenshot).

Here is my code:
import xlrd
import xlutils
from xlutils.copy import copy


if __name__ == "__main__":
    file = "./_some_file.xls"
    book_r
= xlrd.open_workbook(file, formatting_info=True)
    book_w
= copy(book_r)
    book_w
.get_sheet(0).name = u'Renamed Sheet1'
    book_w
.save(file)


The modified excel file has the correct cell formatting but the header and footer are not copied into it.


I also would like to modify the header cell which contains "c" (see attached file). Does anyone know how to do that?

Kind Regards
Aleks
pythonXLS.png
Reply all
Reply to author
Forward
0 new messages