I'm trying to change the format in an excel file that has been created using the XlsxWriter module in Python, but so far I haven´t been able to do it. Whenever I open the file in Excel and try to change the border formats nothing happens.
The code I´m using is doing what it is supposed to:
#Test Sheet
#Format
_format = workbook.add_format({'top':True, 'bottom': True, 'right': True, 'left': True})
_era.to_excel(writer, sheet_name='Test', header=False, index=False, startcol = 2, startrow = 2)
workbook = writer.book
worksheet = writer.sheets['Test']
worksheet.hide_gridlines(2)
worksheet.conditional_format(2, 2, 20, 11, {'type': 'no_blanks', 'format': _format})
The Output:
But afterwards, when I try to change the cell borders format in Excel, nothing happens, it stays the same:
And the result is the exact same thing I downloaded in the first place:
I've tried lots of things, but I must be missing something regarding the code I´m using, is there somebody willing to help?
Cheers.
The reason this is happening is because the data grid is being formatted with a conditional format and that overrides any manual border format that is later applied to the cells.
This isn't related to XlsxWriter. It would also happen with a file created in Excel.