Hi all --

I'm having a problem that I'm hoping you can help me with.

I tried to search for pertenant articles for this before posting, but didn't find an answer amongst the very numerous posts concerning Excel. If the answer has already been posted, please direct me to it.

We've developed an Excel document, with pull-down controls on the first worksheet, and columns of data in the second worksheet that are used to populate said pull-down controls.

Now, we'd like to make this document available from a CGI script, which would be running on a *NIX server. It would pull data from a DB and populate those columns on the second worksheet.

Here's my problem: I can't seem to find something that will let me open an Excel document (i.e. a "template" workbook), modify/populate an existing worksheet, and then save it (or write it out to an HTTP stream).

Win32::OLE looks great, but I'm on *NIX.

Spreadsheet::ParseExcel and Spreadsheet::WriteExcel are good for reading and writing, but (as far as I can tell, correct me if I missed something), you can't write something that you parsed -- you have to painstakingly recreate the entire workbook via the WriteExcel interface, item by item. (A writer that works with a ParseExcel object seems to be on the todo list...)

Have I misunderstood these modules, or missed others that are out there?

Also, while I'm asking... we'll eventually want to lock down (i.e. add password protection) to parts of the workbook, including the worksheet that contains the data for the pull-down controls. Whatever modules you suggest for the problem stated above, will it allow me to either lock the worksheet, or work with a locked worksheet (and lock it again after I'm done)?

Thanks!
-Dave

In reply to Modifying an Excel doc (UNIX) by dpmott

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.