#!perl use strict; use warnings; use Win32::OLE; use Win32::OLE::Const 'Microsoft Excel'; $Win32::OLE::Warn = 3; # Die on Errors. # config my $dir = 'c:\\temp\\'; my $file = 'test.xls'; my $Excel = Win32::OLE->new('Excel.Application', 'Quit'); $Excel->{DisplayAlerts} = 0; #$Excel->{Visible} = 1; my $wb = $Excel->Workbooks->Open($dir.$file); my $ws = $wb->sheets(1); my $cell = $ws->Cells(1,1); $cell->{Value} = '567'; $cell->Interior->{Color} = rgbLightGreen; $cell->Font->{Color} = rgbDarkGreen; $wb->SaveAs($dir.'copy_'.$file); $wb->Close;