This project has moved and is read-only. For the latest updates, please go here.

Cell NumberFormat and Displayed Text

Aug 10, 2011 at 8:05 PM

Hi ,


I’m trying to format and .xlsx file and read the contents of the formatted file and export to a csv file. When exporting to the csv  the datecolumn value some of them are displayed as “40630”.


I have set the column style property as below:

worksheet.Column(2).Style.Numberformat.Format  = "mmmm dd yyyy"


When I look up the data in column the values look as the above format. While reading in code the cell.value=40630.


Ay ideas?






Aug 12, 2011 at 2:12 PM


Dates are stored as numbers in Excel. Use the ExcelRange.GetValue<DateTime>() to convert it to a valid DateTime.

If you want the formatted value, use the ExcelRange.Text property.


Aug 12, 2011 at 7:17 PM

Thanks Jan. Will try that.

Sep 6, 2012 at 7:06 AM
Edited Sep 6, 2012 at 7:07 AM


I want to export Integer values to a column in excel, but I see a small triange in the left top corner in all the cell saying "number is stored as text"

what should be done?