Skip to content
New issue

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

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

Already on GitHub? # to your account

CopySheet null ref exception if image is in sheet #972

Closed
bpierson opened this issue Nov 30, 2022 · 3 comments
Closed

CopySheet null ref exception if image is in sheet #972

bpierson opened this issue Nov 30, 2022 · 3 comments

Comments

@bpierson
Copy link

Line 443 of POIXMLDocumentPart throws a null ref exception if the sheet contains an image.

@bpierson
Copy link
Author

bpierson commented Nov 30, 2022

Weirdly, this code does work, that is using IWorkbook.CloneSheet(...).

var xl = mySheet.Workbook;
var clone = xl.CloneSheet( xl.GetSheetIndex( mySheet ) );
xl.SetSheetName( xl.GetSheetIndex( clone ), "MyNewSheet" );

@tonyqus
Copy link
Member

tonyqus commented Dec 20, 2022

Can you share the original Excel file and let me know which sheet are you copying?

@tonyqus
Copy link
Member

tonyqus commented May 6, 2024

duplicate with #287

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants