0

我的目标是通过 Excel VBA 运行 Arena 模拟并获得 Excel 模拟结果。我写了一些代码。

如您所见,我的代码启动了 Arena 模拟。参数“j”保存模拟的解。我想要的是写下所有复制结果。例如,j1(第一次复制的结果)、j2、j3 ...等。我该怎么做?

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
4

0 回答 0