Automation provides a standard method for one application to access the objects and properties of other applications. Maros and Taro support Automation processes so both tools can be controlled from any program that is written with Microsoft Visual Basic for Applications (VBA).
The Maros and Taro object model provides all of the functionality necessary to manipulate data that is stored in models, and it provides the ability to control many aspects of the user interface (UI).
Traditionally, users have implemented automation processes via Microsoft Excel VBA Macros. For instance, when trying to populate (or re-populate) a model with new reliability data, a Macro VBA programming via a can be used to run through a spreadsheet, identify the elements in Maros and Taro and replace the reliability data.
Using Macros in Microsoft Excel
VBA Macros in Microsoft office can be accessed via the Developer tab. To access the Developer tab on the ribbon of an Office application, you must configure it to show that tab because it doesn’t appear by default. In order to show the Developer tab in Microsoft Excel:
- Start Excel
- On the File tab, choose the Options button.
- In the Excel Options dialog box, choose the Customize Ribbon button.
- Check the box for Developer
Adding Developer tab
When accessing the Developer tab, a range of new buttons will be shown. In order to access Microsoft Visual Basic for Applications Editor click on “Visual Basic”, as shown below:
This will prompt another window:
Microsoft Visual Basic for Applications Editor
In Microsoft Word Visual Basic Editor, you can create references to object libraries or code in an external document or template. This allows you to call external procedures as if they were written in your own project.
Before you can use the Maros and Taro VBA functions in the Visual Basic Editor, you must establish a reference to Maros and Taro object. In the Visual Basic Editor, with a module active, click References on the Tools menu, and then select Maros 9 or Taro 5, as shown below.
References for Maros and Taro
To make it easier to move/share automation code between Maros and Taro we have defined the object model as DNVRAM. Each object could have a number of functions that correspond to an action that you can perform interactively.
Example showing the object referencing for Import Macro
It is important to remember that examples of Excel Macro provided by DNV have no warranty or liability associated with its use. Investigating problems related to Macros is not part of the Service Level agreement but we tend to help customers depending on the complexity of the work. Should you need assistance and we agree on helping, have the policy not to investigate any macro problems unless they have Option Explicit defined and they have selected Compile to check fro errors.
Author: Victor Borges