If you really want "0200" to show up as a text string, put a single quote before the first "0" -- despite M$'s explanatory promise in the "format" option that numbers will be displayed "exactly" emphasis supplied as entered. TTBOMK, excel does not provide any means to treat something that looks like a number with leading zeros, EXCEPT via the "Custom" option. You may want to pursue that if you really want "0200" to appear verbatim as a (text) string but (I think) also remain useable as a number, in the style of perl magic.

(But note davies' method posted above as I tried to sort out your intent).

The "7/18/1900" looks that date of the 200th day after Windows epoch date (1/1/1900). For a guess, the leading "T" and trailing "xt" reflect the fact that the Time element is missing from the 4 digits "0200."

More generally, perldoc WIN32::OLE contains some Excel examples... followed by a section on VARIANT(s). That may be worth perusing. And some folk (search for it) have reported good success learning about methods/quirks/etc in the interface between perl and Excel at the Micro$oft sit. That's probably worthwhile too.


In reply to Re: Formatting cells in Excel by ww
in thread Formatting cells in Excel by David S

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.