#!/usr/bin/perl use warnings; use strict; use Win32::OLE qw( in with ); use Win32::OLE::Const 'Microsoft Excel'; $Win32::OLE::Warn = 3; my $excelfile = 'test.xls'; my $excel = Win32::OLE -> GetActiveObject( 'Excel.Application' ) || Win32::OLE -> new( 'Excel.Application', 'Quit' ); $excel -> {DisplayAlerts} = 0; $excel -> {Visible} = 0; $excel -> {SheetsInNewWorkBook} = 1; my $workbook = $excel -> Workbooks -> Add(); my $sheet = $workbook -> Worksheets( 1 ); $sheet -> Activate; $sheet -> {Name} = 'Tabelle_Eins'; $sheet -> Range( 'A1' ) -> {Value} = 5; $sheet -> Range( 'A2' ) -> {Value} = '=IF(A5>3, "Yes", "No")'; $workbook -> SaveAs( { Filename => $excelfile, FileFormat => xlWorkbookNormal } ); $workbook -> Close; $excel -> Quit; undef $workbook; undef $excel;