I have two sheets in an Excel file and the first one is a cover sheet which I don\'t need to edit. There are a few merged cells in the cover sheet, and when I edit the file usin
Simple method
Go to the folder C:\Python\Lib\site-packages\ openpyxl\worksheet folder\
Open worksheet.py file
In merge_cells function comment the following lines
min_col, min_row, max_col, max_row =
range_boundaries(range_string)
rows = range(min_row, max_row+1)
cols = range(min_col, max_col+1)
cells = product(rows, cols)
all but the top-left cell are removed
for c in islice(cells, 1, None):
if c in self._cells:
del self._cells[c]
Save it.
That's all , it works for me.