AttributeError: 'MergedCell' object attribute 'value' is read-only

6,129 views
Skip to first unread message

georgi.g...@strypes.eu

unread,
Mar 11, 2019, 9:06:19 AM3/11/19
to openpyxl-users
Hello,

I have the following problem:

When I import an excel file , I am merging six fields into one but when I try to add value to the top left field (in order for all fields to have value):

ws.cell(row=8, column=31).value = 'Test'

but this gives me the following error: AttributeError: 'MergedCell' object attribute 'value' is read-only.

When I tested the same code but on different lines (ws.cell(row=70, column=1).value = 'Another test'), where these cells are also merged, it is all working fine.
Has someone encountered the same problem or has any ideas how to cope with the situation?

Kind Regards,

Georgi



lance...@neptuneswap.com

unread,
Apr 2, 2019, 10:37:54 AM4/2/19
to openpyxl-users
Same problem here, we need a way to compatible with the so many legacy code. 

lance...@neptuneswap.com

unread,
Apr 2, 2019, 10:47:33 AM4/2/19
to openpyxl-users
The merged cell makes v2.6 a breaking change. I've try to bypass set value on merged cell, but it breaks the rendering result
of our massive legacy excel templates. It's so frustrated the breaking change happened without alternative solution now.
It's seems v2.5.14 is fine.
Reply all
Reply to author
Forward
0 new messages