Winnovative Excel C# Read Text of cell

204 Views Asked by At

i'm using Winnovative Excel Library for .NET and i'm able to read the value/text of a cell using this:

var cellText = firstWorksheet["A2"].Text;

But i'm not able to read the "raw text" if the cell is numeric or has a datetime value, I know I can see the value in:

var cellText = firstWorksheet["A2"].Value;

But this gives me {15/01/2017 12:00:00 a. m.} and I need the real string in file (15/01/2017)

Someone have used this third party library?

1

There are 1 best solutions below

0
Nahue Gonzalez On

If firstWorksheet["A2"].Value returns a Datetime, you could do something like:

celltext = celltext.ToShortDateString();

If not, try converting to DateTime firstWorksheet["A2"].Value and repeat step 1.