adolpht has asked for the wisdom of the Perl Monks concerning the following question:
I've been trying to get the Spreadsheet::WriteExcel write method working for a while without success. I've read *some* of the perldoc, esp:
"So for those of you who prefer to assemble Ikea furniture first and then read the instructions, here are three easy steps:
1. Create a new Excel *workbook* (i.e. file) using "new()".
2. Add a *worksheet* to the new workbook using "add_worksheet()".
3. Write to the worksheet using "write()".
Like this:
use Spreadsheet::WriteExcel; my $workbook = Spreadsheet::WriteExcel->new("perl.xls");$worksheet = + $workbook->add_worksheet();$worksheet->write('A1', "Hi Excel!"); "
I always get the error "No such file or directory"
perl.xls gets created, but thats it.
I tried this code for degugging:
use Spreadsheet::WriteExcel; use strict; print "Spreadsheet::WriteExcel VERSION $Spreadsheet::WriteExcel::VERSI +ON\n"; unlink("perl.xls"); my $workbook = Spreadsheet::WriteExcel->new("perl.xls") or die "failed to create new workbook: $!"; my $worksheet = $workbook->add_worksheet() or die "failed to create new worksheet: $!"; my $status; eval { $status = $worksheet->write('A1', "Hi Excel!") or die $! }; print "write failed: $@ with status $status\n" if $@;
and get:
Any pointers would be appreciated.... I have also read a fair bit more of the perldoc, but can't find anything.Spreadsheet::WriteExcel VERSION 2.10 write failed: No such file or directory at worksheet.pl line 11. with status 0"
Cheers Tony
I'm using
v5.8.4 built for MSWin32-x86-multi-thread
Retitled by davido.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Spreadsheet::WriteExcel write failure
by rdfield (Priest) on Jan 11, 2005 at 11:39 UTC | |
by adolpht (Novice) on Jan 11, 2005 at 12:36 UTC | |
by gellyfish (Monsignor) on Jan 11, 2005 at 12:39 UTC | |
by adolpht (Novice) on Jan 11, 2005 at 12:54 UTC | |
by Errto (Vicar) on Jan 12, 2005 at 05:19 UTC | |
|
Re: Spreadsheet::WriteExcel write failure
by jmcnamara (Monsignor) on Jan 11, 2005 at 11:06 UTC | |
|
Re: Spreadsheet::WriteExcel write failure
by trammell (Priest) on Jan 11, 2005 at 15:44 UTC | |
by reneeb (Chaplain) on Jan 11, 2005 at 19:29 UTC | |
by trammell (Priest) on Jan 11, 2005 at 23:01 UTC |