my $excel_template = $file_sys_path . $invoice_page_name; my $Excel = Win32::OLE->GetActiveObject('Excel.Application') or Win32::OLE->new('Excel.Application', 'Quit') or die "Could not start excel"; $Excel->{'Visible'} = 0; $Excel->{DisplayAlerts} = 0; my $book = $Excel->Workbooks->Open( $excel_template ) or die ; # open Excel file