AmesimKnowledge

The Simcenter Amesim Export module in detail > Direct interfaces > Simcenter Amesim and the Visual Basic applications interface

Using the AMEVbaInterface.bas VBA module

The AMEVbaInterface.bas VBA module includes 5 subroutines, that can be called in the main code of a VB application.

Warning

This module is deprecated. Consider using the Simulation Scripting API instead. This API can be found here: %AME%\scripting\VBA\amesim.xlt.

Many combinations of calls to these subroutines can be performed by skilled VBA developers. However, the most common use of the AMEVbaInterface.bas VBA module is comprised of 10 steps.

Procedure

  1. Call the AMEVbaGetPar subroutine.

It reads parameter titles, parameter values and variable titles from an Simcenter Amesim system and puts them into 3 tables. Parameters and variables are imported from Simcenter Amesim to the VBA code.

  1. Add in the main code a process that reads parameter and variable tables and displays these elements in the project interface (worksheet cells for example). This is the responsibility of the VBA developer. Parameters and variables are imported from the VBA code to the project interface (Excel for example).

  2. Let the final user modify parameter values by hand, in the project interface, where these parameters have been written in step 2.

  3. Read parameters that may have been modified by the final user, and put them into 2 temporary tables (these tables can be the same as defined in step 1). This is the responsibility of the VBA developer. Parameters are exported from the project interface to the VBA code.

  4. Call the AMEVbaPutPar subroutine.

It reads contents of the 2 temporary tables (new parameter titles and values) filled in step 4 and puts them into an Simcenter Amesim data file linked to the current Simcenter Amesim system. Parameters are exported from the VBA code to Simcenter Amesim.

  1. Call the AMEVbaRun subroutine.

It reads parameters defined by the final user, it then runs the simulation, finally it writes simulation results in an Simcenter Amesim result file.

  1. Call the AMEVbaGetFinalRes subroutine.

It reads simulation final results (titles and values) and puts them into 2 final result tables. Final results are imported from Simcenter Amesim to the VBA code.

  1. Add in the main code a process that reads final result tables and displays final results in the project interface. This is the responsibility of the VBA developer. Final results are imported from the VBA code to the project interface.

  2. Call the AMEVbaGetRes subroutine.

It reads simulation results (titles and values) and puts them into 2 result tables. Results are imported from Simcenter Amesim to the VBA code.

  1. Add in the main code a process that reads result tables and displays results in the project interface. This is the responsibility of the VBA developer. Results are imported from the VBA code to the project interface.

Source: https://docs.sw.siemens.com/en-US/doc/254352342/PL20250521841123434.amesim_collection.Export/Using_the_AMEVbaInterfacebas_VBA_module · retrieved 2026-07-17