in reply to Excel::SpreadSheet : Can't call method "set_column" on an undefined value

If you look at the synopsis of Spreadsheet::WriteExcel, then you will see:

use Spreadsheet::WriteExcel; # Create a new Excel workbook my $workbook = Spreadsheet::WriteExcel->new("perl.xls"); # Add + a worksheet $worksheet = $workbook->add_worksheet();

you are using ->sheets(0) and not add_worksheet() which is incorrect.

Replies are listed 'Best First'.
Re^2: Excel::SpreadSheet : Can't call method "set_column" on an undefined value
by nathanvit (Beadle) on Sep 23, 2004 at 10:32 UTC
    Thanks i know but in worksheet method you can read sheets() and here it seems you can also use this method to get a sheet.
    Probably i fall at this point?

      With sheets() you get a list (or one) existing worksheet, you can't use it to create one. (I guess)

      Try adding a worksheet, and then using the sheets() method, then it will probably work.