Being forced from NPOI to microsoft interop, I have to perform a task of finding a certain worksheet in workbook, and then iterate through every row of it.
In NPOI i
Use workbook.Sheets[sheetName];
Complete working example:
using Microsoft.Office.Interop.Excel;
class Program
{
static void Main(string[] args)
{
var excelApplication = new Application();
excelApplication.Visible = true;
excelApplication.SheetsInNewWorkbook = 3;
var workbook = excelApplication.Workbooks.Add();
var worksheet = workbook.Sheets["Sheet2"]; //<--- desired method
worksheet.Activate();
}
}