problems writing existing worksheet

Discussion in 'Perl Misc' started by C.Nieboer@gmail.com, Jun 3, 2005.

  1. Guest

    Hello,

    I'm verry new with Perl....blahblah

    I have a perl script who read out a txt file and extract some
    information from it. The output of it is placed in a new Excel file
    create with:

    my $workbook = Spreadsheet::WriteExcel->new($file);
    my $worksheet = $workbook->addworksheet();
    my $format = $workbook->add_format();

    But what i want is that the output comes in an existing workbook and
    overwrite a specific (existing) worksheet.

    The perl script is called from a VBA macro so the xls file where to
    write the output is allready open.

    I've looked on several sites and tried several things, but i cant get
    it work. I have tried OLE Spreadsheet:SimpleExcel&WriteExcel.

    Can someone tell me which module i have to use... and maybe good
    tutorial url for this problem.

    Allready Thanks CN
    , Jun 3, 2005
    #1
    1. Advertising

  2. wrote in news:1117793625.036970.137720
    @g43g2000cwa.googlegroups.com:

    > I'm verry new with Perl....blahblah


    As you have noticed, pointing out your experience level is completely
    unnecessary, so please don't do it.

    Please read the posting guidelines for this group to learn how to help
    yourself and help others help you.

    > I have a perl script who read out a txt file and extract some
    > information from it. The output of it is placed in a new Excel file
    > create with:
    >
    > my $workbook = Spreadsheet::WriteExcel->new($file);
    > my $worksheet = $workbook->addworksheet();
    > my $format = $workbook->add_format();
    >
    > But what i want is that the output comes in an existing workbook and
    > overwrite a specific (existing) worksheet.
    >
    > The perl script is called from a VBA macro so the xls file where to
    > write the output is allready open.


    Given that you are already using VBA etc, you should probably be looking
    into using Win32::OLE and manipulating the worksheet through Excel's OLE
    interface.

    I do not think you can write to a file that is open for full access by
    Excel.

    Sinan

    --
    A. Sinan Unur <>
    (reverse each component and remove .invalid for email address)

    comp.lang.perl.misc guidelines on the WWW:
    http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
    A. Sinan Unur, Jun 3, 2005
    #2
    1. Advertising

  3. Guest

    Sinan,

    Thanks for your reply.
    I've tried the past weekend several things, because i hoped there was a
    way to write to an open excel file. But i think i have to look for a
    cut and paste option, or something like that.

    Thanks for your help CN

    A. Sinan Unur schreef:
    > wrote in news:1117793625.036970.137720
    > @g43g2000cwa.googlegroups.com:
    >
    > > I'm verry new with Perl....blahblah

    >
    > As you have noticed, pointing out your experience level is completely
    > unnecessary, so please don't do it.
    >
    > Please read the posting guidelines for this group to learn how to help
    > yourself and help others help you.
    >
    > > I have a perl script who read out a txt file and extract some
    > > information from it. The output of it is placed in a new Excel file
    > > create with:
    > >
    > > my $workbook = Spreadsheet::WriteExcel->new($file);
    > > my $worksheet = $workbook->addworksheet();
    > > my $format = $workbook->add_format();
    > >
    > > But what i want is that the output comes in an existing workbook and
    > > overwrite a specific (existing) worksheet.
    > >
    > > The perl script is called from a VBA macro so the xls file where to
    > > write the output is allready open.

    >
    > Given that you are already using VBA etc, you should probably be looking
    > into using Win32::OLE and manipulating the worksheet through Excel's OLE
    > interface.
    >
    > I do not think you can write to a file that is open for full access by
    > Excel.
    >
    > Sinan
    >
    > --
    > A. Sinan Unur <>
    > (reverse each component and remove .invalid for email address)
    >
    > comp.lang.perl.misc guidelines on the WWW:
    > http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
    , Jun 7, 2005
    #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. harshan
    Replies:
    0
    Views:
    519
    harshan
    Jul 20, 2004
  2. =?Utf-8?B?U2hhbyBZb25n?=

    How to delete an Excel worksheet by using ASP.NET?

    =?Utf-8?B?U2hhbyBZb25n?=, May 10, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    1,124
    Martin Dechev
    May 12, 2004
  3. nrm
    Replies:
    3
    Views:
    517
  4. Replies:
    0
    Views:
    176
  5. Katja
    Replies:
    1
    Views:
    201
Loading...

Share This Page