use strict; use warnings; use Win32::OLE; my $xl = Win32::OLE->new('Excel.Application'); $xl->{Visible} = 1; my $nShtsOld = $xl->{SheetsInNewWorkbook}; $xl->{SheetsInNewWorkbook} = 1; my $wb = $xl->Workbooks->Add; $xl->{SheetsInNewWorkbook} = $nShtsOld; my $delResp = $wb->Sheets(1)->Delete; unless (defined $delResp) { print "delete failed: ".Win32::OLE::LastError()."\n"; } else { print "sucessfully deleted sheet #1\n"; }