When copying sheets, charts lose attributes

When copying sheets, charts lose attributes.

I am generating an Excel file by copying a template sheet a number of times. Afterwards the templates are filled with data. The copies of the sheets are generated as such:

xls.Worksheets.InsertCopy(index, "sheet" + index, ws);

However, on the ‘original’ sheet, the chart that’s on it loses its title. On the copies, the chart also loses one of its Y axes, and both its axis labels. The formatting also changes.

Does anyone know what is going on?

Hi Marinus,

Can you send us your template file which has the original chart so that we can reproduce this issue and investigate it?

Regards,
Mario

Please find the template file here: https://wetransfer.com/downloads/e17fff91d26fd2157fb3ec58c6a1c01220221104135412/b55568b9f5cedab557be0a2a40440ea220221104135427/5ce91b

Thanks in advance.

Hi Marinus,

Please try again with this bugfix:
https://www.gemboxsoftware.com/spreadsheet/nightlybuilds/GBS49v1158.zip

Or this NuGet package:
Install-Package GemBox.Spreadsheet -Version 49.0.1158-hotfix

Also, there is still a problem with some lost information (labels, titles, etc.) which occurs because the chart is using external references (external Excel file) for them.
For example, the word “Conductivité” comes from cell “Template!$B$39” in the “/dev/ReportGenerator/ItwDocument/Template/Burgeap excel templateV2.xlsx” file.

As a workaround, can you replace those external references with local references (the direct cell references from the same Excel file)?
For example, please try this:

Regards,
Mario