I have some existing .xlsx files. I want to add content to the header and footer to each file in every worksheet without changing the content within the file. I have the following code with the xlsxwriter module:
import xlsxwriter
workbook = xlsxwriter.Workbook('headers_footers.xlsx')
preview = 'Select Print Preview to see the header and footer'
worksheet = workbook.add_worksheet('Test')
header = '&L&G'
footer = '&L Content Footer'
worksheet.set_header(header, {'image_left': 'logo_white.jpg'})
worksheet.set_footer(footer)
workbook.close()
Works fine when creating a new .xlsx file but it does not adding the header- and footercontent to existing files.
Where is the problem?
Thanks