Bad excel docs with Spreadsheet::WriteExcel::Simple

Discussion in 'Perl Misc' started by Erica, Sep 5, 2003.

  1. Erica

    Erica Guest

    I've been trying to create an excel document with
    SpreadSheet::WriteExcel::Simple on Windows 2000 Server, and open it
    with MS Excel 7.0 (old, I know, but all my more recent copies seem to
    be on bad CDs).
    A 6.0 KB file is created, but when I try open the Excel file in Excel
    I get an error, "Cannot access xxx.xls."

    This is what I'm doing:
    use Spreadsheet::WriteExcel::Simple;

    $ss = Spreadsheet::WriteExcel::Simple->new;
    @headings = ("One", "Two", "Three");
    @headings = ("1", "2", "3");
    $ss->write_bold_row(\@headings);
    $ss->write_row(\@data);
    open FILE, ">xxx.xls";
    print FILE $ss->data;
    close FILE;

    Does anyone have any ideas about what I might be doing wrong?

    Thanks,
    Erica
     
    Erica, Sep 5, 2003
    #1
    1. Advertising

  2. Erica

    Jay Tilton Guest

    (Erica) wrote:

    : I've been trying to create an excel document with
    : SpreadSheet::WriteExcel::Simple on Windows 2000 Server, and open it
    : with MS Excel 7.0 (old, I know, but all my more recent copies seem to
    : be on bad CDs).
    : A 6.0 KB file is created, but when I try open the Excel file in Excel
    : I get an error, "Cannot access xxx.xls."
    :
    : This is what I'm doing:
    : use Spreadsheet::WriteExcel::Simple;
    :
    : $ss = Spreadsheet::WriteExcel::Simple->new;
    : @headings = ("One", "Two", "Three");
    : @headings = ("1", "2", "3");
    : $ss->write_bold_row(\@headings);
    : $ss->write_row(\@data);
    : open FILE, ">xxx.xls";
    : print FILE $ss->data;
    : close FILE;
    :
    : Does anyone have any ideas about what I might be doing wrong?

    An Excel worksheet file contains binary data.
    binmode() the filehandle before writing.
     
    Jay Tilton, Sep 5, 2003
    #2
    1. Advertising

  3. In article <>,
    Jay Tilton <> wrote:
    > (Erica) wrote:
    >
    >: I've been trying to create an excel document with
    >: SpreadSheet::WriteExcel::Simple on Windows 2000 Server, and open it
    >: with MS Excel 7.0 (old, I know, but all my more recent copies seem to
    >: be on bad CDs).
    >: A 6.0 KB file is created, but when I try open the Excel file in Excel
    >: I get an error, "Cannot access xxx.xls."
    >:
    >: This is what I'm doing:
    >: use Spreadsheet::WriteExcel::Simple;
    >:
    >: $ss = Spreadsheet::WriteExcel::Simple->new;
    >: @headings = ("One", "Two", "Three");
    >: @headings = ("1", "2", "3");
    >: $ss->write_bold_row(\@headings);
    >: $ss->write_row(\@data);
    >: open FILE, ">xxx.xls";
    >: print FILE $ss->data;
    >: close FILE;
    >:
    >: Does anyone have any ideas about what I might be doing wrong?
    >
    >An Excel worksheet file contains binary data.
    >binmode() the filehandle before writing.
    >


    Also, i suspect the second @headings assignment was meant to be
    a @data assignment. I know, i'm critiquing an example, but just
    in case.

    --
    -john

    February 28 1997: Last day libraries could order catalogue cards
    from the Library of Congress.
     
    John M. Gamble, Sep 5, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Fabio

    Spreadsheet::WriteExcel

    Fabio, Mar 2, 2004, in forum: Perl
    Replies:
    2
    Views:
    896
    Tom Niesytto
    Mar 4, 2004
  2. Sven Jungnickel
    Replies:
    3
    Views:
    213
    John McNamara
    Jul 29, 2004
  3. Zhidian Du
    Replies:
    1
    Views:
    139
    A. Sinan Unur
    Dec 11, 2003
  4. Sean Berry

    Spreadsheet::WriteExcel

    Sean Berry, May 8, 2004, in forum: Perl Misc
    Replies:
    11
    Views:
    263
    Sean Berry
    May 9, 2004
  5. A Ymous

    Query about Spreadsheet::WriteExcel

    A Ymous, Sep 10, 2004, in forum: Perl Misc
    Replies:
    1
    Views:
    125
    Carl Inglis
    Dec 2, 2004
Loading...

Share This Page