I have a xlsx file, for all of its sheet I need to change the formatting of the header row to apply background color to it.
But when I am adding fomratting to the row, instead of the columns which contain my data, it gets applied to all other empty columns.
Here is what I have tried :
for sheet_name in xlwriter.sheets:
ws = xlwriter.sheets[sheet_name]
ws.freeze_panes(1, 0) # Freeze the first row.
cell_format = workbook.add_format({'bg_color': 'yellow'})
cell_format.set_bold()
cell_format.set_font_color('red')
cell_format.set_border(1)
ws.set_row(0, cell_format = cell_format)
P.S : I have tried solution from other question which I was getting as suggestion for this question but none of that works for me.