I am using
use Spreadsheet::ParseExcel; use Spreadsheet::WriteExcel;
Yes, there is a sheet named Sales in one of the formulas. From what I have read, this should be possible.

Yes, their are two sheets. One named "How_Am_I_Doing" and the other "Sales".
There are numerous other cells, that have other formulas, for instance on sheet Sales there is one '=D3*E2, which calculates just fine. But all the cells with worksheet links cause errors, by removing those cells from the spreadsheet, everything writes fine. Here is some more of the code:
foreach my $sheet (keys %$storage_book){ my $dest_sheet = $dest_book->addworksheet($sheet); foreach my $row (keys %{$storage_book->{$sheet}}){ foreach my $col (keys %{$storage_book->{$sheet}->{$row}}){ if ($sheet eq "Sales") { if ($storage_book->{$sheet}->{$row}->{$col} eq 'Agent') { $getsales=1; #next row start getting sales } elsif ($storage_book->{$sheet}->{$row}->{$col} eq 'Total') { $getsales=0; #stop getting sales } #GET THE AGENTS NAME if (($getsales ==1) && ($col == 0)) { #performs a sql query here } } if (($getsales == 1) && ($col == 4) && ($sheet eq "Sales") && ($ +agentname eq "Agent")) { $dest_sheet->write($row, $col, $exchange_rate); } elsif (($getsales == 1) && ($col == 2) && ($sheet eq "Sales")) { if ($agentname eq "Agent") { $dest_sheet->write($row, $col, $storage_book->{$sheet}->{$ro +w}->{$col}); } else { $dest_sheet->write($row, $col, $cdnsales); } } elsif (($getsales == 1) && ($col == 3) && ($sheet eq "Sales")) { if ($agentname eq "Agent") { $dest_sheet->write($row, $col, $storage_book->{$sheet}->{$ro +w}->{$col}); } else { $dest_sheet->write($row, $col, $usdsales); } } else { if (($row == 0) && ($col == 1) && ($sheet eq "Sales")) { $dest_sheet->write($row, $col, $startdate); } elsif (($row == 0) && ($col == 3) && ($sheet eq "Sales")) { $dest_sheet->write($row, $col, $today); } else { ###HERE IS LINE 265 $dest_sheet->write($row, $col, $storage_book->{$sheet}->{$ro +w}->{$col}); } } } # foreach column } # foreach row } # foreach sheet $dest_book->close();

In reply to Re: Perl Excel Formulas With Worksheet Links by cheryld497
in thread Perl Excel Formulas With Worksheet Links by cheryld497

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.