Delete row/column from Excel with xlsxwriter

Viewed 7115

Is it possible?

I know ws.set_row('B:B', options={'hidden': True})

But, is there something like ws.set_row('B:B', options={'delete_row': True})?

3 Answers

To quote the Worksheet docs:

"""
The options parameter is a dictionary with the following possible keys:

'hidden'
'level'
'collapsed'
""""

Other values like delete_row are not acceptable.

It doesn't seem possible to do what you ask. Probably the best approach remains the one proposed in this old post.

You cannot delete a column with XlsxWriter. The best option is to structure your application so it doesn't write data to the column in the first place.

Related