I have this code to get the first cell of an arx of .xlsx
Excel.Application excelApp = new Excel.Application();
excelApp.Visible = true;
string workbookPath = "c:/Libro1.xlsx";
Excel.Workbook excelWorkbook = excelApp.Workbooks.Open(workbookPath, 0, false, 5, "", "", false, Excel.XlPlatform.xlWindows, "", true, false, 0, true, false, false);
Excel.Sheets excelSheets = excelWorkbook.Worksheets;
string currentSheet = "Hoja1";
Excel.Worksheet excelWorksheet = (Excel.Worksheet)excelSheets.get_Item(currentSheet); //en esta instruccion me sale la excepcion
Excel.Range excelCell = (Excel.Range)excelWorksheet.get_Range("A1", "A1");
string str = (excelCell.Cells as Excel.Range).Value2;
MessageBox.Show(str);
but as soon as I execute it, I open the page with excel, is there any way to work with the file without opening the program?