unless($grab) { $workbook->Sheets("Timing_calcs")->Delete(); } $workbook->Close; i tried all possible ways explained in the previous threads such as $worksheet2->Delete; #### $workbook->Worksheets("Timing_calcs")->Delete();