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

Issue #1260 new
Max Henke created an issue

using openpyxl=2.6.2

when loading a workbook, at least for some, the following error happens:
wb = load_workbook(filename=path, data_only=True, keep_links=False)
(tried without keep_links too)

error:

wb = load_workbook(filename=path, data_only=True, keep_links=False)

File "C:\Users\XXX\AppData\Local\Programs\Python\Python37-32\lib\site-packages\openpyxl\reader\excel.py", line 312, in load_workbook

 reader.read()

File "C:\Users\XXX\AppData\Local\Programs\Python\Python37-32\lib\site-packages\openpyxl\reader\excel.py", line 274, in read

 self.read_worksheets()

File "C:\Users\XXX\AppData\Local\Programs\Python\Python37-32\lib\site-packages\openpyxl\reader\excel.py", line 228, in read_worksheets

 ws_parser.bind_all()

File "C:\Users\XXX\AppData\Local\Programs\Python\Python37-32\lib\site-packages\openpyxl\worksheet\_reader.py", line 405, in bind_all

 self.bind_hyperlinks()

File "C:\Users\XXX\AppData\Local\Programs\Python\Python37-32\lib\site-packages\openpyxl\worksheet\_reader.py", line 373, in bind_hyperlinks

 self.ws[link.ref].hyperlink = link

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

Comments (5)

  1. Max Henke reporter

    For everyone who doesn't need hyperlinks:
    I "solved" the problem for me by commenting out line 372 + 373 in "openpyxl\worksheet_reader.py"
    but that doesnt solve the issue

  2. Log in to comment