I am developing an excell add-in for some purpose. My add-in needs to get cell values ignoring system regional settings. For example an excel spreadsheet is like in attached file "sample1.jpg". I get the values of the cells like this:
Excel.Range range = _WorkSheet.get_Range("C1",
string val = range.Cells.Value2.ToStrin
range = _WorkSheet.get_Range("D1",
string val2 = range.Cells.Value2.ToStrin
In English regional settings val = "125,50 TL" and val2 = "18.05.2010". But in Turkish regional settings val = "125,5" and val2 = "40316". Somehow "TL" is ignored and datetime is converted to an int value. I change regional settings to English programatically when my add-in works but the result doesn't change. So i decided to use "Text" property instead of "Value2" property of the Cells. This time everything seems to be ok when all the columns are expanded but when the columns are not expanded to show the values as shown in "sample2.jpg", val = "125,5 TL" and val2 = "########"
So, how can i get the cell values ignoring regional settings and the column's width?