I am afraid you can't do what you're trying to do directly with WriteExcel. The Excel data format isn't your typical Unix-like data stream that can be written to by one process and read by another.

If I were doing this, I would consider splitting the program into two pieces.

One piece would write the data that comes out of your equipment control to some kind of simple log file format. This would run continuously throughout your data run. If you do this right it will be very simple, so you won't run a big risk of losing data or crashing your run because of a software error.

The second piece would read that log file format and use WriteExcel to pop out an up-to-the-minute copy of your spreadsheet. It would run to completion quickly, rather than having to wait for your equipment. You could run this anytime you need to see results. For example, you might run it every hour during your seven-hour run to see how things are going.


In reply to Re: Open Excel while writing & Save file by Ollie Jones
in thread Open Excel while writing & Save file by perly_newbie

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.