I have been having issues with VSTA macros hanging. I have to kill the vsta_epx64.exe process to get them to start again. From what I can tell, if I run a macro, it starts a vsta_epx64 process. This hangs around after any macro completes. When the macro is run a second time, the a second instance is created and the first is terminated. The problem seems to caused if the first instance will not terminate. In this case, the second instance will just hang. Once I manually kill the first process, the second pops up an error saying it can not start the dll. And then it will work correctly the third time, starting the process all over again.
I'm guessing that there is some bug in my macro that prevents it from terminating but I can't duplicated it at will, just randomly. It is a large macro with forms such. From what I can tell, all my code completes as expected and it is hanging when attempting to free some object.
This does not happen when run from the debugger. The instance of vsta_epx64 always terminates when the macro completes.
I can create a similar experience that will hang even a simple "beep" macro if I, from the debugger use the "start without debugger" to create the first instance and then when it completes (leaving a hanging vsta_epx64 process) start a second one with a the debugger on.
And again, I can create similar issues if I attempt to run the macro from within Solidworks (from a toolbar button) and then attempt to debug it. You must restart Solidworks to edit the macro after you run it once. Since the runtime version uses a different instance of the DLL than the debugger, if there was a hung vsta_epx64 process, this would be understandable (but not acceptable)
Can anyone shed some light on this?
Currently SW 2012/SP2.0, Windows7, X64 but also had same problem on SW2011
SolidworksApi macros