Comments missing in read-only mode

Issue #1067 closed
Romesh Abeysuriya
created an issue

When I load a workbook using openpyxl.load_workbook(...,read_only=True) the ReadOnlyCell objects don't contain any comment attribute, so I get AttributeError: 'ReadOnlyCell' object has no attribute 'comment' if I try to access say cell.comment. The same code runs fine with read_only=False. I was wondering if there is a particular reason why comments aren't read in read-only mode?

Comments (4)

  1. CharlieC

    Yes, the problem is that the reference to the comments part is stored at the end of the worksheet which means the whole sheet has to be read in order to assign comments correctly. This would largely defeat the optimisation of read-only mode.

  2. Log in to comment