Thanks.

Like I said, I could reproduce the issue after about 40 rows: ie, first 40ish rows were green, the other 60ish were not formatted at all. It may be that it's different on different machines (32 vs 64bit Win; 32 vs 64bit Excel; Excel version; Spreadsheet::WriteExcel version, etc1). In this post, for example, Eily was able to "reproduce the defect with 300 lines of dummy data", so it may take a different number of rows for you or someone else.

Since I was able to replicate the problem with 100 lines of random data, I didn't put much thought into "well-conditioned". But yes, for SSCCE-purposes, the OP should have been able to post example data in <readmore>data</readmore> tags. But given that the newerlbie has declared that the issue is fixed, apparently the OP was on a system where it was hitting a similar limit to what Eily and I found.

And really, there's no good reason to have the $header1 format inside the loop, so putting it outside is arguably "better", even if you haven't hit the limit (ie, avoiding defining a large number of items which are all identical)


1: My experiment was run with Spreadsheet::WriteExcel v2.40, Strawberry Perl v5.26.2 64bit, Win10.0.16299.611 64bit, Office 365 Excel 2016 MSO 16.0.9126.2259 32-bit


In reply to Re^4: Perl 2 Excel by pryrt
in thread Perl 2 Excel by newperlbie

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.