For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > August 2004 > Win32::OLE, setting Excel font









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Win32::OLE, setting Excel font
a440guy

2004-08-17, 2:09 pm

I want to set a font in the entire Excel spreadsheet. When I wun the code below, I get the following error:

Can't call method "Font" without a package or object reference [line 4 below]...

I havent' worked with the OLE API before, so I got this from some examples that I saw:

my $Book = $xl->Workbooks->Add;
my $Sheet = $Book->Worksheets(1);
my $Selection = $Sheet->cells->select;
$Selection->Font->Name = 'Arial Unicode MS';

I interpret the error message to mean that 'Selection' is not an object. How does one set the font?
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com