writeexcel->sheets() fails

0 views
Skip to first unread message

Anand

unread,
May 5, 2008, 7:35:16 PM5/5/08
to Spreadsheet::WriteExcel
I am trying to read an excel file usign the writeexcel. Following is
the code-snippet:
my $workbook = Spreadsheet::WriteExcel->new('Temp.xls');

print "Cannot create Temp.xls: $!\n" if (not defined $workbook);

foreach $worksheet ($workbook->sheets()) {
print "Worksheet Name is: ".$worksheet->get_name()."\n";
}

The file Temp.xls is already existing in the directory. I want to
further modify the worksheets. However, the sheets() method itself is
not working.
What might be the reason? I'm using perl 5.8

Thanks,
Anand.

jmcnamara

unread,
May 5, 2008, 7:50:54 PM5/5/08
to Spreadsheet::WriteExcel

On May 6, 12:35 am, Anand <anand.acha...@gmail.com> wrote:
> I am trying to read an excel file usign the writeexcel.

Hi,

You are not off to a good start.

Spreadsheet::WriteExcel is a module for writing Excel files not
reading them. For that you need the Spreadsheet::ParseExcel module
(http://search.cpan.org/~szabgab/Spreadsheet-ParseExcel/) or to modify
an Excel file see the following:

http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel/lib/Spreadsheet/WriteExcel.pm#MODIFYING_AND_REWRITING_EXCEL_FILES

John.
--
Reply all
Reply to author
Forward
0 new messages