use Win32::OLE; $Win32::OLE::Warn = 3; my $file = "myfile.xls"; my $Excel = Win32::OLE->GetActiveObject('Excel.Application') or die 'Excel not running'; for my $n ( 1 .. $Excel->Workbooks->Count) { print $Excel->Workbooks($n)->Name , "\n"; $Excel->Workbooks($n)->Close(1, $file, undef); } $Excel->Quit();