removing gridlines from excel using python
I'm trying to remove gridlines from excel worksheet which I created using openpyxl, and it's not working. I'm doing this:
wb = Workbook() ws = wb.get_active_sheet() ws.show_gridlines = False print ws.show_gridlines wb.save('file.xlsx')
The that code prints the 'False', yet the saved file shows gridlines.
There is a relevant issue in openpyxl issue tracker. Plus, according to the source code show_gridlines is just a worksheet class property that has no affect at all. Just watch the issue to get any update on it.
from xlsxwriter.workbook import Workbook workbook = Workbook('hello_world.xlsx') worksheet = workbook.add_worksheet() worksheet.write('A1', 'Hello world') worksheet.hide_gridlines(2) workbook.close()