shwea88 has asked for the wisdom of the Perl Monks concerning the following question:

Hello Friends, I am trying to delete the sheet from the excel book, but when i execute my perl code nothing happens the sheet is still there, I need to delete this sheet because the input file to this code isn't have anything to print in this sheet hence it gives out a blank sheet I am checking if it is blank and then delete.. using,
unless($grab) { $workbook->Sheets("Timing_calcs")->Delete(); } $workbook->Close; <c> i tried all possible ways explained in the previous threads such as <c> $worksheet2->Delete;
and
$workbook->Worksheets("Timing_calcs")->Delete();
nothing worked.. kindly help..

Replies are listed 'Best First'.
Re: How to delete the sheet in the excel workbook with win32:ole environment
by perl_walker (Novice) on Oct 31, 2012 at 06:53 UTC

    Hi shwea88

    Try this

    $Excel->{DisplayAlerts}=0; ... ... $workbook->Sheets("Timing_calcs")->Delete; $workbook->Save(); ...