Hi monks,

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:

Spreadsheet::WriteExcel VERSION 2.10 write failed: No such file or directory at worksheet.pl line 11. with status 0"
Any pointers would be appreciated.... I have also read a fair bit more of the perldoc, but can't find anything.

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.