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

better error message when trying to copy a sheet from one Excel instance to another using Workbook.__setitem__ #231

Closed
alixdamman opened this issue Apr 28, 2017 · 3 comments

Comments

@alixdamman
Copy link
Collaborator

No description provided.

@alixdamman alixdamman added the bug label Apr 28, 2017
@gdementen
Copy link
Contributor

I cannot reproduce this issue except when copying a sheet from another Excel instance, which is not supported by Excel. Was that what you tried? In that case, we could check if this is the case and produce a nicer exception.

@alixdamman
Copy link
Collaborator Author

Well, I messed up in my sandbox.py and unfortunately created 2 Excel workbooks. Then I tried to copy a sheet between the 2 workbooks leading to the expected crash.

@gdementen gdementen added enhancement and removed bug labels May 4, 2017
@gdementen gdementen reopened this May 4, 2017
@gdementen gdementen changed the title Workbook.__setitem__ crashes when value is a Sheet object better error message when trying to copy a sheet from one Excel instance to another using Workbook.__setitem__ May 4, 2017
@gdementen
Copy link
Contributor

Here is a test case:

>>> wb1 = open_excel()
>>> wb1['toto'] = 'hello'
>>> wb2 = open_excel()
>>> wb2['lulu'] = wb1['toto']
com_error                                 Traceback (most recent call last)
...
com_error: (-2147352567, 'Exception occurred.', (0, 'Microsoft Excel', 'Copy method of Worksheet class failed', 'xlmain11.chm', 0, -2146827284), None)

gdementen added a commit to gdementen/larray that referenced this issue May 9, 2017
gdementen added a commit that referenced this issue Aug 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants