We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Reading excel file and converting to DataTable

I use ExcelRW to read and excel file and convert it to a DataTable. Can you help me with the following questions? 1. I used ExportDataTable to convert from IWorksheet to DataTable. However, the generated DataTable contained the formulas from the excel file. How can I get everything exported as numbers? 2. Is there a way to determine the last used row and column in the excel file? Thanks, Kjetil

1 Reply

AD Administrator Syncfusion Team May 3, 2005 11:32 AM

Hi Kjetil, 1) This is a shortcoming of the ExportDataTable method. I have filed a request to add an option to export the computed value http://www.syncfusion.com/support/issues/excelrw/Default.aspx?ToDo=view&questId=287 Currently, you could get the computed value by using IRange.FormulaNumberValue mySheet.Range["A1"].FormulaNumberValue 2) The last used row and column can be got using the IWorksheet.UsedRange example, mySheet.UsedRange.End.Column Thanks, Stephen. >I use ExcelRW to read and excel file and convert it to a DataTable. Can you help me with the following questions? > >1. I used ExportDataTable to convert from IWorksheet to DataTable. However, the generated DataTable contained the formulas from the excel file. How can I get everything exported as numbers? > >2. Is there a way to determine the last used row and column in the excel file? > >Thanks, >Kjetil

Loader.
Live Chat Icon For mobile
Up arrow icon