Removing gridlines from excel using python (openpyxl)

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.

As an alternative solution, try the new and awesome xlsxwriter module. It has an ability to hide grid lines on a worksheet (see docs). Here's an example:

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()

This was fixed in 2015.

Here is the recommended solution (from description of issue)

from openpyxl import Workbook
wb = Workbook()
ws = wb.active
ws.sheet_view.showGridLines
True
ws.sheet_view.showGridLines = False
wb.save("gridlines.xlsx")

Beware that you should type ws.sheet_view.showGridLines and not ws.showGridLines.