no $workbook->Close; in Spreadsheet::WriteExcel but in Win32::OLE?

Discussion in 'Perl Misc' started by Zhidian Du, Dec 11, 2003.

  1. Zhidian Du

    Zhidian Du Guest

    When I write a program that need the xls file immediately after
    finishing writing the xls file. Why there is no $workbook->Close; to
    close the current file? If I use this single program, it's ok. But
    how can I let the .xls file to be used by the following programs?

    I found in Win32::OLE, it has the counterpart.


    Thanks.

    Z. Du



    #! /usr/bin/perl
    use Spreadsheet::WriteExcel;
    use Spreadsheet::WriteExcel::Big;


    my $workbook = Spreadsheet::WriteExcel->new( "myfirstExcel.xls" );

    my $worksheet = $workbook->addworksheet();
    my $workformat = $workbook->addformat();

    $workformat->set_bold(1);

    $row = 0;
    $coloumn = 0;

    $workformat->set_bold( 1 );


    #$workformat->set_column('A:A', 125);

    #worksheet->Columns("A:A")->{ColumnWidth} = 25;

    $worksheet->set_column( 'A:A', 125);
    $worksheet->set_column( 'B:D', 125);


    #$worksheet->write( 0, 0, "Results", $workformat );
    $worksheet->write( 0, 0, "Results");

    $worksheet->write( 0, 1, "Long resutl is how to seccuess" );


    $workformat->set_bold();
    $workformat->set_bottom(6);


    $worksheet->set_column(0, 0, 12 );
    $worksheet->set_column(11, 11, 12);

    my $dir = "/u/dian/test";

    #$workbook->SaveAs( $dir . '/perl_ole.xls');

    #--------------Here it is-----------
    #$workbook->Close;

    print "test\n";
     
    Zhidian Du, Dec 11, 2003
    #1
    1. Advertising

  2. (Zhidian Du) wrote in
    news::

    > When I write a program that need the xls file immediately after
    > finishing writing the xls file. Why there is no $workbook->Close; to
    > close the current file?


    I do not have Spreadsheet::WriteExcel installed checking the docsquickly
    reveals that there issuch a method indeed.

    http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel-0.42/WriteExcel.pm

    > #$workbook->SaveAs( $dir . '/perl_ole.xls');


    On the other hand there is no mention of this method.

    > #$workbook->Close;


    Case matters in Perl.

    --
    A. Sinan Unur

    Remove dashes for address
    Spam bait: mailto:
     
    A. Sinan Unur, Dec 11, 2003
    #2
    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:
    887
    Tom Niesytto
    Mar 4, 2004
  2. Erica
    Replies:
    2
    Views:
    110
    John M. Gamble
    Sep 5, 2003
  3. Sven Jungnickel
    Replies:
    3
    Views:
    207
    John McNamara
    Jul 29, 2004
  4. Sean Berry

    Spreadsheet::WriteExcel

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

    Query about Spreadsheet::WriteExcel

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

Share This Page