Hi,
I have a spreadsheet template and a data spreadsheet which I am trying
to combine. If the data spreadsheet is an xls file, this works okay.
Unfortunately the data sheet I have to use is an XML Spreadsheet, and the styles are not copied.
I have tried the following:
template.Excel.Open(@“C:\aspose\template_with_code.xls”);
designer.Excel.Open(@“C:\aspose\data_with_styles.xml”,
FileFormatType.SpreadsheetML);
template.Excel.Combine(designer.Excel);
I have also tried copying the individual sheets with the same result:
template.Excel.Open(@“C:\aspose\template_with_code.xls”);
designer.Excel.Open(@“C:\aspose\data_with_styles.xml”,
FileFormatType.SpreadsheetML);
foreach(Aspose.Excel.Worksheet sheet in designer.Excel.Worksheets)
{
int newSheet =
template.Excel.Worksheets.Add(sheet.Type);
template.Excel.Worksheets[newSheet].Name =
sheet.Name;
template.Excel.Worksheets[newSheet].Copy(sheet);
}
I have attached the template spreadsheet to this post and the data one (xml spreadsheet) to the next message.
Thanks
Verge