Hi Roy,
Sorry for the long delay in getting back to you. I am not sure if I understand your requirements correctly. However
1) To preserve the chart properties in the template worksheet please use the following code :
IWorkbook workbook = application.Workbooks.Open(@"..\..\Data\ChartsTemplate.xls",ExcelParseOptions.DoNotParseCharts);
Here is a sample which does this:
ChartsTemplate.zip
2) If you need to add a chart sheet to a template document please use the following peace of code:
//Adding a New(Embedded chart) to the Worksheet
IChartShape shape = sheet.Charts.Add();
shape.DataRange = sheet.Range["B3:D6"];
Here is a sample for your reference:
Embedded_Charts.zip
Regarding the "Worksheet already exists" Exception. This will be thrown only when adding a worksheet with the same name as a already existing worksheet. Please take a look at the samples and let me know if you
have any queries.
BestRegards,
Bharath