Hi Peter
Yes, your requirement can be achieved through XlsIO. If a workbook of CSV type contains a formula, then calculated value of the cell can be exported to Datatable by assigning the CalculatedValue property of the cell to Value property of the cell which is illustrated in the following code example.
Code example:
sheet.EnableSheetCalculations(); foreach (IRange range in sheet.UsedRange) { // Assign the calculated value to value of the cell range.Value = range.CalculatedValue; } sheet.DisableSheetCalculations();
// Export to Datatable |
We have also shared the sample for your reference which can downloaded from following link.
Sample link: http://www.syncfusion.com/downloads/support/directtrac/general/ze/Open_CSV1602557067.zip
Regards,
Dilli babu.
Hi Peter,
Thank you for updating us.
Yes, long number will be preserved as a string by enabling range.IsStringsPreserved property. Instead of enabling this property for every range, you can enable IWorksheet.IsStringsPreserved property which preserves the value as string through the worksheet.
Regards,
Dilli babu.