I am using this code to get the first cell of the file
Excel.Application excelApp = new Excel.Application();
excelApp.Visible = true;
string workbookPath = "c:/Users/Edgar/Desktop/base/Libro1.xlsx";//C:\Users\Edgar\Desktop\base\Libro1.xlsx
Excel.Workbook excelWorkbook = excelApp.Workbooks.Open(workbookPath, 0, false, 5, "", "", false, Excel.XlPlatform.xlWindows, "", true, true, 0, true, false, false);
Excel.Sheets excelSheets = excelWorkbook.Worksheets;
excelApp.Visible = false;
string currentSheet = "Hoja1";
Excel.Worksheet excelWorksheet = (Excel.Worksheet)excelSheets.get_Item(currentSheet);
Excel.Range excelCell = (Excel.Range)excelWorksheet.get_Range("A1", "A1");
string str = (excelCell.Cells as Excel.Range).Value2;
MessageBox.Show(str);
but I want to save in a variable the number of rows that are filled in xlsx
I understand that you did not follow the advice of the other question
Work with xlsx file without excel opening in c#?
where we recommend using a library based on open xml
>>I want to save in a variable the number of rows that are filled in xlsx
could you use
Worksheet.UsedRange Property
then you would