The cell value is read as #### in excel

I am reading a cell value from excel using a named range in my case when the column width is less than the value that is present in the cell and therefore it appears as ##### when it is a huge number.

when i read this from csharp it reads as #####. Any fix for this

Code example:

Excel.Application.get_Range(strRange, Type.Missing).Text.ToString() //If i make it 
Excel.Application.get_Range(strRange, Type.Missing).Value2.ToString() //and read any date string i get 40390
+3
source share
3 answers

Without any reading code, I would suggest that you read the display line or similar information that Excel will update each time the line width changes.

You probably need to read a more raw value.

+3
source

.Text , , Excel ( ####, ) .Value2 Excel.

/ Excel , 1900 , , 24 , .

, Format: (40390, "ddmmyyyy" ) (40390, "dd/mmm/yyyy" )

+2

Perhaps you are trying to import negative dates? Excel does not handle these best results, since double dates usually work.

0
source

Source: https://habr.com/ru/post/1743499/


All Articles