About Excel Components
An Excel component is an embedded Excel table inserted within a PTC Mathcad worksheet. With the Excel component you can leverage Excel’s tabular data presentation within PTC Mathcad. You can edit and format your data using all Excel tools, within the PTC Mathcad worksheet. You can insert several Excel components in a single PTC Mathcad worksheet. When you insert an Excel component, you create a single worksheet named Sheet1. To refer to other worksheets, you must create worksheets within the Excel application.
Excel components also leverage Excel’s calculation capability within PTC Mathcad. You can embed an Excel worksheet, send values to the Excel worksheet, and extract values from it. Thus Excel calculation can be part of the calculation flow of the PTC Mathcad worksheet.
For the supported versions of Excel, refer to the
Platform Support document.
Excel Component Structure
Each Excel component contains a preview of an Excel table. The Excel component block is divided into three areas: Inputs, the component table, and Outputs:
• Input expressions specify which data is sent to the component table. You can use previously defined variables from your PTC Mathcad worksheet as inputs. You can also use scalars, vectors, matrices, and strings. You can specify a single cell, or a range of cells that contain the input expressions.
• The displayed component table in a PTC Mathcad worksheet is a preview of the full Excel component table. Double-click it to open the full component table in Excel and edit it.
• Output expressions specify which data from the component table is assigned to PTC Mathcad variables. You can specify a single cell or a range of cells to assign to your output variables.
You can add as many input expressions and output expressions as you want. The default input and output expressions refer to cell A1 of the first Excel worksheet. However, if you first open the Excel application and select some cells, the default expressions correspond with that selection.
Changes you are making in Excel and the Excel worksheet you are working on are immediately displayed inside your PTC Mathcad worksheet, depending on the component table viewable area. However, calculation of input and output expressions cannot occur when the Excel application is open. The cell scrolling is updated only when Excel is updated or closed.
Microsoft Excel does not support units. When you transfer expressions containing units to Excel, values are converted to the basic unit of their dimension and units are stripped out. In the following example 1 ton is converted to kilogram.
Uses of Excel Components
• An Excel component is an embedded Excel object, providing you with full Excel tabular data presentation, functionality, and formatting abilities from within PTC Mathcad.
• PTC Mathcad variables are easily linked to an Excel file and the data is embedded inside a PTC Mathcad worksheet.
• You can save the data in an Excel component as an external file using Excel. However, there is no link between the saved file and the Excel component. Changing data in the Excel file does not change data in the Excel component and vice versa.