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

Issue with copying worksheets to another workbook, something about Excel Tables #1454

Closed
nmanring opened this issue May 20, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@nmanring
Copy link

EPPlus usage

Commercial use (I have a commercial license)

Environment

Windows

Epplus version

7.1.2

Spreadsheet application

Excel

Description

I am writing code that will merge multiple excel files into one workbook. There is an issue that I have narrowed down to be something related to an excel table being part of the worksheet causing a problem. I'm attaching my start file and the result produced. The result produced will give you an error if you open in excel and after continuing all styling is lost. I am not doing anything special in code, just creating a new excelpackage and then opening an existing excelpackage and copying all worksheets to the new package (also making sure to guarantee unique worksheet names). The specific copy method I use is oPackage.Workbook.Worksheets.Add(newName, wksht);
where wksht is the worksheet form the excelpackage i am copying from, and oPackage is the new excelpackage I have created.

If in my workbook I convert the excel table to a range and try again, the error goes away and it works correctly. This leads me to believe it is something to do with the table but not sure what specifically is the issue and if it can be addressed.

Let me know if you need any more information,
Thank you

tabletest3.xlsx
tabletest3output.xlsx

@nmanring nmanring added the bug Something isn't working label May 20, 2024
@swmal
Copy link
Contributor

swmal commented May 21, 2024

Hi @nmanring ,
we will try to replicate this using the workbook you have uploaded. Will get back to you if we need more details.

JanKallman added a commit that referenced this issue May 21, 2024
@swmal
Copy link
Contributor

swmal commented May 23, 2024

This is fixed and will be released in the next version

@JanKallman
Copy link
Contributor

Fixed in EPPlus 7.1.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants