You haven't provided working code, so I'm reduced to guessing. However, you may well have a mistake that I often kick myself for making. Excel renumbers sheets after each insert and delete. Therefore, if you have code anything like:
for (1..2) {$wb->Sheets($_)->Delete;}
(untested), and there are two sheets in the book, what will happen is that sheet 1 will be deleted, sheet 2 will be re-indexed to 1 and then the attempt to delete sheet 2 will crash, because there is now only 1 sheet in the book.
Another possibility is that you should be using
Sheets() instead of
Worksheets(). Working code really does help us to help you. We don't want business logic - we're far more interested in Perl! But, as others have said, please don't shout.
Regards,
John Davies
Update: another possibility is that you are trying to delete every sheet in the book. That will never work - Excel can't accept books with no sheets.