There is no simple right or wrong; it all depends on what you want to do. TIMTOWTDI and all that.

But, for standard use, please x $bignum, pretty please three times with a cherry on top, don't use GetObject or anything else that takes over an existing copy of Excel, Word or anything else. You don't know why I have opened it. It might be running a macro that will not stop for several days. It might become available at a critical point during a process when user input is required but the user is tearing a piece of paper off the end of a roll. It might have all sorts of strange options set because the user is developing something interesting. I could go on, but I'm sure you get the message. Open your own instance of Excel. If that means that two instances are open, that's fine. I do it all the time, and not just for automation purposes. It's built to take it. On the rare occasions that I use Excel 2013, it seems slow to me, too. That may not be a function of automation, let alone the invocation process. There are all sorts of tricks you can play to speed up automation such as preventing screen updating, recalculation, event handlers and the like. But that's an Excel subject rather than a Perl one.

Regards,

John Davies


In reply to Re: Win32-OLE: What is the canonical way to open file for editing? by davies
in thread Win32-OLE: What is the canonical way to open file for editing? by woland99

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.