I have a mathcad file that calculates two scaler answers based upon 3 input arrays. And I was hoping someone here would be kind enough to help me out getting this thing to work.

Looking online, I stubled across the perl module WIN32::OLE and then going through the mathcad help file it says that mathcad can interface with OLE programs to inclue those the user creates. So, basically I found the key but I am not sure how to use it. I looked over the example code given (which is for excel and not mathcad) and salvaged what I could from it.

To make sure we are on the same page lets call the input @Array1, @Array2, and @Array3 and the answers $Answer1 and $Answer2. The name of the mathcad sheet lets just call it Trial.xmcd and suppose the path if needed is c:\documents and settings\desktop.

Based upon example code I put this together so far but after this I am completly clueless on how to put everything in or get anything out out

#!/usr/ym/util/perl use Win32::OLE; #use existing instance if mathcad is already running eval {$ex = Win32::OLE->GetActiveObject('Mathcad.Application')}; die "Mathcad not installed" if $@; unless (defined $ex) { $ex = Win32::OLE->new('Mathcad.application', sub{$_[0]->Quit;}) or die "Unable to start Mathcad"; }
Thank you in advance for any help you can give,
Aaron

In reply to WIN32::OLE interface to Mathcad by forgedascendant

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.