in reply to don't understand bless

You don't need to bless anything most likely. That error is telling you that $Excel doesn't contain an object and so you can't call a method on it.

bless() is used in creating objects, so to make the error message make more sense think of it as "Can't call method Workbook on a non-object"

Frank Wiles <frank@revsys.com>
www.revsys.com

Replies are listed 'Best First'.
Re^2: don't understand bless
by lepetitalbert (Abbot) on Mar 27, 2008 at 08:08 UTC

    Hello dear Monks,

    Thank you all for your help

    This seems to be second strange bug I'm facing with perl / apache / excel.

    this morning I went back to the code which first gave me error :

    my $Excel = Win32::OLE->new('Excel.Application') or die "Could not + start excel"; $Excel->{'Visible'} = 0; $Excel->{DisplayAlerts} = 0; my $Book = $Excel->Workbooks->Open ( $excel_template ) or die "Could not open excel template $excel_template"; # open + Excel file my $Sheet = $Book->Worksheets(1) or die "Could not get Worksheet i +n $excel_template"; $Sheet->Cells( 9 , 7 )->{Value} = "$name";

    and it works again !?

    If anyone has an idea where to search ? apache / perl / OLE / excel ?

    Have a nice day

    "There is only one good, namely knowledge, and only one evil, namely ignorance." Socrates