John

Thanks for your attention. I'm using Excel 2002 (10.3506.3501) SP-1. The code you supplied creates a spreadsheet that does show the same message--however, I'm not sure characterizing it as a warning is accurate.

Here's what I see: in the A2 cell, I see 12345 with a little green tab in the upper left corner of the cell. I believe that means something like "this is a number stored as a string". Then if I select the cell, a little yellow icon with a "!" appears next to the cell. Clicking on that produces a menu with these optinons:

  • Number stored as text
  • Convert to number
  • Help on this error*
  • Ignore error
  • Edit in formula bar
  • Error checking options
  • Show formula auditing toolbar
  • I am, admittedly, an excel illiterate. I just write the scripts that create the damn things for my colleagues for whom they seem to have near religious significance (ie banker-types). I don't even know what the implication of having a number stored as text is, except that it seems to be left-aligned by default instead of right aligned like the other numbers.

    I looked more closely at the docs last night after I went home and noticed that you provide the regexp that is used to determine which incarnation of write() to use--and that explains why numbers in the format "10,000" are being interpreted as strings. However, I'm still weirded out by the fact that "16.036" is being treated as a string by excel, if not by your module.

    I'll also take a closer look at my excel preferences--it occurs to me that excel could be getting too "smart" for its own good (why does that always seem to happen with MS apps?) and this might have nothing to do with your module.

    Thanks for your help.

    AH

    * naturally, the built-in help docs make no mention of this :)

    ----------
    Using perl 5.6.1 unless otherwise noted. Apache 1.3.27 unless otherwise noted. Redhat 7.1 unless otherwise noted.

    In reply to Re: Re: Spreadsheet::WriteExcel, numbers v strings? by alienhuman
    in thread Spreadsheet::WriteExcel, numbers v strings? by alienhuman

    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.