Can't set max_row or max_column in ReadOnlyWorksheet

Issue #1204 resolved
Brandt created an issue

When using load_workbook(file, read_only=True).active the returned worksheet is of the class ReadOnlyWorksheet. In the documentation it specifically states, as it was for the previous version before 2.6.x that to set max_row = max_column = None in order to avoid the bounds being default set to 1 and 1 respectively. In the 2.6.x update, these values were made unsettable, as can be seen in this commit.

With the new version 2.6.x and going forward, my question is, what is the proper way to get around this known issue with read_only mode?

Comments (2)

  1. CharlieC

    It's a good question. I reckon it's probably a good idea to protect the dimensions via properties, the previous code didn't really make a lot of sense. You can, of course, always use ws.calculate_dimensions(force=True) if you want to know the size. We could add a method to reset dimensions for worksheets (usually coming from LibreOffice) that are incorrect. I just hate adding workarounds for producing libraries allocations. Much better if they get fixed!

  2. Log in to comment