I'm reading an excel file with interop but I'm getting different values than I see on screen. I don't know what can be happening.
Excel that I'm reading:
When I read the cell E5 or E6 I'm getting the text "NUM VAGON", but what I see in screen is "Nº VAGON", the same with others rows and columns, different value of what I see and what I get.
There is no other worksheet so this is not the problem. If I copy all text in another excel it works fine.
The same applies with Value and Value2.
Here is my code:
xl.Application app = null;
try
{
//app = new Microsoft.Office.Interop.Excel.ApplicationClass();
app = new Microsoft.Office.Interop.Excel.Application();
//xl.Workbook theWorkbook = app.Workbooks.Open(eFile, 0, true, 5, "", "", true, xl.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0);
xl.Workbook theWorkbook = app.Workbooks.Open(eFile);
//xl.Sheets sheets = theWorkbook.Worksheets;
//xl.Worksheet worksheet = (xl.Worksheet)sheets.get_Item(1);
xl.Worksheet worksheet = (xl.Worksheet)theWorkbook.Sheets[1];
xl.Range range = null;
range = worksheet.get_Range("E6", "E6");
//System.String titulo = (System.String)range.Cells.Value2;
System.String titulo = (System.String)range.Cells.Text;