Hi Gerald,
Thank you for your interest in Essential XlsIO.
Essential XlsIO does not have a calculation engine of its own, so it is not able to compute the values of the formulas. XlsIO parses the formula string and writes it native binary format understood by MS Excel. MS Excel computes the formula on opening the file. However, the computed value can be retrieved by using Essential Calculate along with Essential XlsIO. Please use the following code snippet to achieve this:
[C#]
//Formula
sheet.Range["B7"].Formula = "SUM(B2:B5)";
sheet.Range["C7"].Formula = "SUM(C2:C5)";
sheet.Range["D7"].Formula = "SUM(D2:D5)";
sheet.Range["E7"].Formula = "SUM(E2:E5)";
//Refresh the calculation engine. The second parameter is true since this is the
//first time we are calling this.RefreshCalcEngine
this.RefreshCalcEngine(workbook,true);
//Export Data from worksheet to data table
DataTable table = sheet.ExportDataTable(sheet.UsedRange, ExcelExportDataTableOptions.ComputedFormulaValues);
//Import to new sheet
newworkbook.Worksheets[0].ImportDataTable(table, false, 1, 1);
MemoryStream stream = new MemoryStream();
stream.Seek(0, SeekOrigin.Begin);
//Saving the workbook to memory.
newworkbook.SaveAs(stream);
Here is a sample using Essential XlsIO and Essential Calculate to copy the resulting data to another file:
http://websamples.syncfusion.com/samples/XlsIO.Windows/F61789/main.htmKindly let me know if you have any other questions.
Thanks,
Melba