in reply to Problem enumerating Worksheets with Spreadsheet::ParseExcel


I get the opposite results. The uncommented loop works and the commented loop gives a warning.

The warning occurs because SheetCount is the index of the last worksheets +1. So I guess this is what you want (although I prefer the other method):

foreach (0 .. $book->{SheetCount} -1) { $sheet = $book->{Worksheet}[$_]; print $sheet->{Name},"\n"; }

--
John.