A NullReferenceException is thrown when copying a sheet containing a chart with Marker whose FIll is null.
There is a workaround which should be applied before copying the sheet:
foreach (FloatingChartShape chart in wsPureCompTemplate.Charts)
{
foreach (SeriesGroup seriesGroup in chart.Chart.SeriesGroups)
{
foreach (SeriesBase series in seriesGroup.Series)
{
LineSeries lineSeries = series as LineSeries;
if (lineSeries != null && lineSeries.Marker != null && lineSeries.Marker.Fill == null)
{
lineSeries.Marker.Fill = new NoFill();
}
ScatterSeries scatterSeries = series as ScatterSeries;
if (scatterSeries != null && scatterSeries.Marker != null && scatterSeries.Marker.Fill == null)
{
scatterSeries.Marker.Fill = new NoFill();
}
}
}
}