Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I agree with hunter2. Your vba script is creating a batch *.bat file to drive PSSe with a python script as argument. You can also call directly PSSe within the vba script. But you only have one opportunity to pass a script to PSSe. Once PSSe is running, it cannot be controlled from 'outside it.'

A workaround to execute multiple python scripts is to force PSSe to quit within the first python script and repeat the process of opening PSSe with a second script. Another workaround is let the batch file call PSSe with a 'master python script' that will 'execfile' multiple python scripts, each to perform different PSSe activities.

A better option (IMHO) is to drop vba for python to call PSSe's API functions, so PSSe is not running explicitly but through its API (see code for dyntools_demo.py in the EXAMPLE folder of the PTI installation - C:\Program Files (x86)\PTI\PSSE33\EXAMPLE) Now you can call as many python scripts as needed or implement their content as functions within this 'main' python code.