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

Hello, I want to access an existing Xls file for writing ,updating and appending through perl. WriteExcel.pm creats a new xls only. ParseExcel only reads an already existing file . How to append and write and already existing xls? Also i thought of Using Spreadsheet::ParseExcel to read the Excel file into a data structure and then Spreadsheet::WriteExcel to write it back But I want to retain the details of the Cell format, Ex -> Colour, Hidden, protected , bold italic etc and formula etc . how to accomplish this ? Appreciate your Time and Effort. -Rad

Replies are listed 'Best First'.
Re: Open Excel File for Updating!!
by reneeb (Chaplain) on Nov 23, 2004 at 11:20 UTC
Re: Open Excel File for Updating!!
by jmcnamara (Monsignor) on Nov 23, 2004 at 20:39 UTC
      Hi , Spreadsheet::ParseExcel::SaveParser does the required work for me ;-))) Thank u all very much ;-)) But I doubt how to maintain the WorkSheet Protection mechanism :-(( -rad
Re: Open Excel File for Updating!!
by dragonchild (Archbishop) on Nov 23, 2004 at 14:25 UTC
    reneeb is absolutely correct - you have to stitch together Spreadsheet::ParseExcel and Spreadsheet::WriteExcel yourself. It has actually been on a number of TODO lists to get some sort of nice solution in place.

    Alternatively, if your spreadsheet is amenable, you could look at DBD::Excel. I've never used it, but it is the only module I'm aware of that will both read from and write to an Excel file on Unix. (There's Tie::Excel, but that's built on Win32::OLE.)

    Being right, does not endow the right to be rude; politeness costs nothing.
    Being unknowing, is not the same as being stupid.
    Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
    Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

Re: Open Excel File for Updating!!
by gothic_mallard (Pilgrim) on Nov 23, 2004 at 09:10 UTC

    Have you looked at Win32::OLE? And this note on the Microsoft website: http://support.microsoft.com/kb/q214797/

    --- Jay

    All code is untested unless otherwise stated.
    All opinions expressed are my own and are intended as guidance, not gospel; please treat what I say as such and as Abigail said Think for yourself.
    If in doubt ask.

      The Tools is a Unix based tool and no Windows :-(( -Rad.