avoid copying a worksheet when not_a_worksheet is passed to wb.copy_worksheet()
Created originally on Bitbucket by kikocorreoso (Kiko Correoso)
Changesets for this Pull Request have not been imported, because it had been already declined on Bitbucket. Marked as closed by the import user.
When I use this code:
import openpyxl
wb = openpyxl.Workbook()
cs = wb.create_chartsheet()
wb.copy_worksheet(cs)
I get:
AttributeError: 'Chartsheet' object has no attribute '_cells'
And a new “Chart copy“ sheet is created.
So I would expect a ValueError and no new sheets created.
This PR tries to fix this.
P.D.: It is not pretty clear to me if I followed correctly the Development section in the documentation. So, in case I made a mistake, please, let me know to fix it.