I want to get the cell value from an excel file with software in C #; NOT TEXT, because the text depends on the size of the column, and I should not change it myself, therefore this software should not be violated. Therefore, my choice was to get value.
I get my cell as a 1: 1 range, so I have a Range object, but the Value field and Value2 are not recognized by the language. I tried with get_Value (), but it needs a parameter, and I donβt know what to insert it, I did not find the documentation about it. Here is my code (extracted from the loop):
if((string)(ws_Varsheet.get_Range("L" + iIndex, "L" + iIndex).Text) != "") { rng_ResolutionCell = ws_Varsheet.get_Range("L" + iIndex, "L" + iIndex); float iResolution; rng_ResolutionCell.Cells.get_Value(&iResolution); //what to do here? str_Resolution = ((string)iResolution.toString()).Replace(",","."); str_Resolution = str_Resolution.Replace(" ",""); mObj.Str_Resolution="1"; }
Can you help me? Thanks in advance.
source share