Hello Monks. I am working on a script that prints a modifiable list of numeric, percentage, and currency values into an .xls file. This file will be viewed by users so formatting matters in this case. When I write a number formatted with commas and a dollar sign or a percentage it displays the information correctly but it also has green triangles, which display a message that states "the number in this cell is formatted as text", in the top left corner of each cell with a formatted number in it. is there a way to tell the excel file to ignore it when this happens or a way to format the values as text that will fix this? i've already tried the below method, it did not work.

$worksheet->write_string(x, y, $value)

here is some code that works perfectly as an example of what i'm talking about. thanks in advance.

use Spreadsheet::WriteExcel; my $workbook = Spreadsheet::WriteExcel->new("Example.xls"); my $worksheet = $workbook->add_worksheet(); $worksheet->write_string(0, 4, '$77,777'); $workbook->close();

In reply to Spreadsheet::WriteExcel cell formatting. by anonymonk

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.