You can grab sheets by name or id, for example:
int index = 1; // note indexes are 1 based in ClosedXML var worksheet = workbook.Worksheet(index); string name = "First"; var worksheet = workbook.Worksheet(name);
Please note that you only want to do this when you know the sheet name and max id (example)
or you can iterate over the collection of worksheets in a book as such:
foreach (IXLWorksheet worksheet in workbook.Worksheets) { Console.WriteLine(worksheet.Name);
You can find this information in the visual studio by pressing F12 on your book object, you will see all public methods / variables to which you also provide access. IXLWorksheet and IXLWorksheets are what you are looking for.
source share