Excel Shows "#########" when i try to write DateTime.Now.tostring() to one of the cell in Excel File

Posted by user1209631 on Stack Overflow See other posts from Stack Overflow or by user1209631
Published on 2012-03-25T17:17:09Z Indexed on 2012/03/25 17:29 UTC
Read the original article Hit count: 112

Filed under:
|

I have created a application in c# , it reads excel file and after checking some conditions, it select a row to be written in another Excel File.

Everything is working fine, but i need to end the file with the DateTime.Now.ToString().

string date = DateTime.Now.ToString();
ExcelWorkSheet2.Cells[newFileRow, 1] = date;

When I see the file created, it shows "########" symbol instead of actual date. When I select that cell , it changes to correct date format.

What may be going wrong?

© Stack Overflow or respective owner

Related posts about c#

Related posts about excel