それでは始めましょう:
use OLE; // Win32::OLE
my $excel = CreateObject OLE 'Excel.Application' or die $!; // Excel
$excel->{'Visible'} = 1; // Excel , ,
my $workbook = $excel -> Workbooks -> Add(); //
$workbook -> ActiveSheet -> Range("A1")-> {'Value'} = sprintf(""); // A1 «»
$workbook -> ActiveSheet -> Columns -> AutoFit; // –
$workbook -> SaveAs("$file"); //
$workbook -> ActiveSheet -> PrintOut; // -
$excel -> Quit; // Excel
出来上がり!
さて、最後にいくつかの便利なこと:
$workbook -> ActiveSheet -> Range("A1")-> Font -> {FontStyle} = 'Bold'; //
$workbook -> ActiveSheet -> Range("A1")-> {HorizontalAlignment} = 3; // –
$workbook -> ActiveSheet -> Range("A1")-> Borders -> {LineStyle} = 1; //
$workbook -> ActiveSheet -> Range("A1")-> Interior -> {ColorIndex} = 15; //
$workbook -> ActiveSheet -> Range("A1")-> EntireRow -> Delete; //
$workbook -> ActiveSheet -> Range("A1:A10") -> Merge; //