As trs80 notes, Spreadsheet::WriteExcel is still a work in progress, and though there has been a great deal of progress, even the very latest version (0.34 as I type) does not support references to sheets outside the current workbook. As you cannot modify existing workbooks with this module, you can't even add a new empty sheet to your existing Results.xls file, and insert the summary formulas you want in there with references to the relevant existing sheet names.

While you could try Win32::OLE if you are on a Windows platform with Excel installed, you might have an easier time of it if you use Spreadsheet::ParseExcel to read the cells you want from the original spreadsheet, then just create a new workbook with Spreadsheet::WriteExcel, inserting the cells you want to keep, no formulas required.

A final note on your actual code: besides the usual use strict; and use warnings; (or -w as your version allows) admonitions, I'd suggest you use the write($row, $col, $formula) method format, as then you don't need to do any string manipulation to create the Excel-style cell names in your loop.

Update: I had no trouble at all using WinZip to install the latest tar.gz distribution from CPAN.

--
I'd like to be able to assign to an luser


In reply to Re: Recent Post to CUFP by Albannach
in thread Recent Post to CUFP by Gerard

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.