prafulltc has asked for the wisdom of the Perl Monks concerning the following question:

Hi ,

Can we use write back to excel file which is opened by
using ParseExcel module ?

I want to read one column from abn excel and add one
column next to it with some values .

Regards,
Prafull

Replies are listed 'Best First'.
Re: Write to Excel
by chilledham (Friar) on May 30, 2012 at 14:54 UTC

    Hi prafulltc,
    I'm working with the assumption you mean https://metacpan.org/module/Spreadsheet::ParseExcel.

    Anyway, that module allows for reading of Excel data. To write data you would need to use another module such as https://metacpan.org/module/Spreadsheet::WriteExcel. In my experience I have not found a module that allows you to open a workbook, add or modify data, and write out to the same file.

    When I've had to solve similar problems I've always read the data from one workbook with S::PE, then created an S::WE object to write out to a new file.

    I couldn't find an AddCell method in Spreadsheet::ParseExcel as zeni suggested. I do see that method in Spreadsheet::WriteExcel.

      In my experience I have not found a module that allows you to open a workbook, add or modify data, and write out to the same file.

      If you're on a Windows system that has Excel installed, the Win32::OLE module will allow you to control Excel, which in turn means that you can open an Excel file, make modifications and save the modifications.

      However, to do those tasks without directly using Excel, I would agree with you about not being aware of a single module to allow for read and write functionality.

        Excellent point, thanks! These days I'm working mostly in Linux or OS X; I had completely forgotten about Win32::OLE.

Re: Write to Excel
by zeni (Beadle) on May 30, 2012 at 11:59 UTC

    You can try using AddCell (for Spreadsheet::ParseExcel).

    CPAN Module : Spreadsheet-ParseExcel-0.59

    'abn' is assumed as 'above'. Hope i am correct.

    Life is a box of chocolates.. Perhaps you get to eat very few best ones!!