in reply to Win32::OLE formatting Excel Worksheet
Note that this is applied to all worksheets in the workbook.#!/usr/bin/perl -w use strict; use Cwd; use Win32::OLE; use Win32::OLE::Const 'Microsoft Excel'; my $application = Win32::OLE->new("Excel.Application"); my $workbook = $application->Workbooks->Add; my $worksheet = $workbook->Worksheets(1); $workbook->Styles("Normal")->{Font}->{Size} = 8; $workbook->Styles("Normal")->{Font}->{Bold} = 1; # Write some text. $worksheet->Cells(1,1)->{Value} = "Hello World"; my $dir = cwd(); $workbook->SaveAs({FileName => $dir . '/win32ole.xls'}); $workbook->Close; __END__
--
John.
|
|---|