in reply to Excel worksheet delete

sharief:

The problem is that your call to $Books->Worksheets($i) is returning an undef, so the remainder of the line looks kinda like undef->Delete() which is nonsensical. Check your return value from your Worksheets call, and perhaps run under the debugger (perl -d foo.pl) so you can inspect values and figure out what's going on inside your code.

...roboticus

When your only tool is a hammer, all problems look like your thumb.