Skip to content
Advertisement

Apply format to a cell after being written in XlsxWriter

I work on python using XlsxWriter and I’ve been trying to solve this problem with no success:

My app must create an Xlsx file in which data is shown in a table-like structure. That table has some empty cells.

I’d like to set borders to some cells to make a grid for the table so I use:

format6 = excelbook.add_format()
format6.set_left(1)
for y in range(24):
    excel.write(y+5, 1, None, format6)

in order to have border applied to those cells. Then, I write data on the table.

Since the table layout is quite complex, it would be easy to write data and, once everything is written, apply format to cells to have borders, but I can’t find the way.

Is there any way to apply format to a cell once it’s been written previously without losing its content?

Thank you in advance.

Advertisement

Answer

I’m the author of that module and unfortunately that isn’t possible.

It is a planned feature, and (a small) part of the internal infrastructure is there to support it, but it isn’t currently available and I can’t say when it will be.

Update: this feature was never implemented and is no longer planned.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement