I have a requirement to construct a Arena simulation model using an entirely separated external VB program, instead of using the build-in VBA programming capabilty. I have some progress on building such program, but not satisfied with the behavior.
- Is it possible to create a Model without starting the Arena.exe?
- If the program halt for any reason (such as termination of debugging) during the model creation steps, the subsequent call to the CreateObject function failed with result like “Cannot create ActiveX/Com objects”. This error still occurs even if I manually kill the Arena.exe via the Task Manager. How to avoid this?
— Current Code —
Try
arenaApp = CType(CreateObject("Arena.Application"), Arena.Application)
arenaModel = arenaApp.Models.Add
... some code to build model, adding modules, blah blah blah, ...
arenaModel.SaveAs(fileName)
Finally
If (arenaApp IsNot Nothing) Then arenaApp.Quit()
End Try
— Platform —
- Platform: Win 7 64
- Visual Studio: 2010 (Express edition)
- DotNet Framework: 4.0
- Arena version: 13.9
- VB Project Reference: C:\Program Files (x86)\Rockwell Software\Arena\Arena.exe
Thanks very much.
Yam Hon
I cannot answer your question directly. However, I would recommend looking over the following lecture notes regarding Arena Integration and Customization.
http://dept.lamar.edu/industrial/Underdown/Simulation/ch10.ppt
As for the error you are experiencing, these links are not directly related to Arena but might contain a solution regarding the “Cannot create ActiveX/Com objects” error.