book.Worksheets returns a collection of worksheets. This collection is a zore-based index. If you have only one sheet in the Excel workbook, then you will get empty at index 1.
If it needs more explanation, please feel free to reach us with more detail also share your Excel file with us in order to get complete picture of the issue.
Well, your code (Worksheet.Cells.Ranges will extract the Workbook specific named ranges and not Worksheet specific named ranges) will work for Workbook(Global) named ranges. You may use Worksheets.GetNamedRanges() to extract both types of ranges.
See the sample code:
Range ranges = book.Worksheets.GetNamedRanges();
for (int i = 0; i < ranges.Length; i++)
For further reference on how to create both types of ranges, see the topic: