Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'ReadOnlyWorksheet' object has no attribute 'merged_cells' #33

Open
Pymancer opened this issue Aug 29, 2019 · 5 comments
Open

'ReadOnlyWorksheet' object has no attribute 'merged_cells' #33

Pymancer opened this issue Aug 29, 2019 · 5 comments

Comments

@Pymancer
Copy link

Pymancer commented Aug 29, 2019

Opening xlsx file with rs = pyexcel.iget_book(file_name='./some_file.xlsx', skip_hidden_row_and_column=False, detect_merged_cells=True) causes an error 'ReadOnlyWorksheet' object has no attribute 'merged_cells'.
May be at

if self.skip_hidden_row_and_column:
should be

if self.skip_hidden_row_and_column or self.detect_merged_cells:

not

if self.skip_hidden_row_and_column:

?
Thank you for the excellent library, by the way :-)

@chfw
Copy link
Member

chfw commented Aug 29, 2019

which version of openpyxl?

@Pymancer
Copy link
Author

Pymancer commented Aug 29, 2019

openpyxl.version=='2.5.14'
pyexcel.version=='0.5.15'

@Pymancer
Copy link
Author

Pymancer commented Sep 4, 2019

Unfortunately

if self.skip_hidden_row_and_column or self.detect_merged_cells:

will not work as expected too because SlowSheet skips hidden columns and rows anyway.

@chfw
Copy link
Member

chfw commented Sep 4, 2019

Then, should I code against this combination? It is down to openpyxl, which does not support both.

@Pymancer
Copy link
Author

Pymancer commented Sep 4, 2019

It is down to openpyxl, which does not support both

At first glance openpyxl returns all rows and then pyexcel-xlsx skips hidden ones right here:

if self._native_sheet.row_dimensions[row_index].hidden is False:

May be in some cases it will be ok to not to skip them, but I didn't look into that enough to assert anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants