**** Thanks everyone! I ended up setting up a check to figure out the excel version and set a max row limit based on the version (since 03 and 07 have different limits). I then set a counter that keeps track of the rows and alerts the user when the max has been reached, saves the document, and closes out. **** Using Win32 OLE in Perl to write excel rows from data I'm retieving from another data source (ReqPro). I write the data as it is retrieved line by line (so there is no way to know how much data there will be). Anyway, I just ran into an issue where I get a generic error when trying to write a row that something was not defined. After an hour or so I finally realized it wasn't the line of code, but rather the spreadsheet had no more rows to write to because it was at 6x,xxx lines. Any idea how to gracefully catch this? How others handle this? I'm hoping though that there is some WIN32 API check I can run in the code before writing a row to check and see I can write a row (or a catch I can include after trying to write a row if it fails)... A couple thoughts if I can't find a good solution: 1) Count the rows each iteration and when around 60,000 rows are reached throw a dialogue message (tk), stop looping, and then on the last row put something like "Reached the max number of rows the spreadsheet can have, however more data does exist...Narrow you query and run again." 2) If rows equal something like 60,000 then insert a new sheet after the current sheet and continue on (and on, and on, and on, until done...)

In reply to Error when reach end excel sheet limit by kgnickl

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.