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.
In reply to Spreadsheet::WriteExcel write failure by adolpht
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |