use strict; use Win32::OLE; my $efile = "c:\\test2.xls"; my $excel_error = 0; my $excel = new Win32::OLE('Excel.Application','Quit') || ($excel_error = 1); if ($excel_error) { undef $excel; die "Unable to open Excel.\n"; } my $book = $excel->Workbooks->Open($efile) || ($excel_error = 1); if ($excel_error) { undef $book; undef $excel; die "Unable to open Excel file.\n"; } $book->Worksheets('Sheet4')->Delete(); $book->Close({SaveChanges => 1}); undef $book; undef $excel;