use Win32::OLE; eval {$excel = Win32::OLE->GetActiveObject('Excel.Application')}; die "Excel not installed" if $@; unless (defined $excel) { $excel = Win32::OLE->new('Excel.Application', sub {$_[0]->Quit;}) or die "Oops, cannot start Excel"; } $workbook = $excel->Workbooks->Open(getcwd() . "/test.xlsx"); $worksheet = $workbook->Worksheets(1); @matrix = ( [0, 1], [2, 3] ); $worksheet->Range("B5:C6")->{Value} = @matrix; $worksheet->Save;