Mathcad's Automation Interface

Mathcad's Automation interface provides a mechanism for communicating with Mathcad from within another Windows application, including a custom stand-alone application you write yourself. Using OLE Automation commands, you can:

To use Automation technology, write a program in Visual Basic 5.0 (or higher) or in an application that can serve as an Automation client, such as Microsoft Excel version 5.0 (or higher). The program you write defines and retrieves variables in Mathcad worksheets. The variables defined in and retrieved from Mathcad can be complex scalars, strings, or matrices. Dimensions (units) are not retained.

Mathcad provides two APIs for automation:

Examples

The following examples of the scripting API suggest what is possible with Mathcad Automation and could form the basis of expanded projects. They demonstrate the use of the primary features of the IMathcad Application API:

  1. A Visual Basic program that displays a Windows form, allowing you to set an input variable, apply this value in an .mcd file, and return the results from the file.
  2. A Visual Basic program that includes a Mathcad OLE Embedded object, which is useful for setting and getting complex values.
  3. An Excel Spreadsheet that allows you to highlight a row of data, feed those values into the correct entries in a Mathcad sheet, and return values from the sheet into new cells in Excel.
  4. An Excel Spreadsheet that uses the embedding interface to set and get complex values.

Notes: