First off, n8g's points are very well taken. If I may, I would like to add a little. If you are using a fully Win32 environment, and actually have Excel as the environment for manipulating your spreadsheets, then Excel itself, perhaps with the aid of Visual Basic for Applications (the programming language built into Excel) would be an ideal solution.

If you are using a non-Windows platform to do the spreadsheet manipulation, then the combination of Spreadsheet::ParseExcel and Spreadsheet::WriteExcel are what you are looking for. ParseExcel will allow you to read the Excel file and pick and choose cells and retrieve the data. Once you have that, you can then use WriteExcel to create your new Excel file.

If you really do want to use Perl, and you are on a Windows platform, then I recommend the ActiveState Perl distribution. It includesWin32::OLE to allow you to programmatically work with Windows applications. If you use a barebones Windows Perl, you can get Win32::OLE from CPAN, if you don't want to install the ActiveState Perl. You can find details from various sites using the proper Win32::OLE Perl Excel search. What you'll have to do in this case is translate the API that is included in MS Office from the Visual Basic for Applications to the Perl Win32::OLE equivalent.

As an aside, for large spreadsheets, the Win32::OLE solution is faster than the Spreadsheet::WriteExcel solution, at least in my experience from a while back. The WriteExcel folks might have greatly improved performance, and I am not criticizing their excellent work, but it is a consideration.


In reply to Re: Writing into an existing excelsheet by Sinistral
in thread Writing into an existing excelsheet by Satish@Stag

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.