my $excel = Win32::OLE->GetActiveObject('Excel.Application')||die "couldnt get active one"; my $workbook = $excel-> Workbooks( $file ); # when file is already opened unless( $workbook ) { $workbook = $excel->Workbooks->Open( $file ) or die "Cannot open $file"; }