My aim is to run Arena simulation via Excel VBA and get results of simulation to Excel. I wrote some codes.
As you can see, my codes start Arena simulation. And parameter "j" holds the solution of simulation. What I want is that write down all replications result. For example, j1 (result of first replication), j2, j3 ... etc. How can I do that?
Sub Test()
Dim oArenaApp As Arena.Application
Dim oModel As Arena.Model, oSIMAN As Arena.SIMAN
Dim oModule As Arena.Module
Set oArenaApp = CreateObject("Arena.application")
ModName = "D:\Model2.doe"
Set oModel = oArenaApp.Models.Open(ModName)
Set oSIMAN = oModel.SIMAN
oArenaApp.Activate
oArenaApp.Visible = True
oModel.BatchMode = True
oModel.QuietMode = True
oModel.Go (smGoWait)
i = oSIMAN.SymbolNumber("Entity 1")
j = oSIMAN.EntitiesNumberOutOfType(i)
oModel.End
oArenaApp.Visible = False
End Sub