Calculate Results from a Model/VBA

Tutorial: Calculate Results from a Model
Below is the VBA version of the tutorial.

VBA Sub Main MyRepository Repository MyRepository.ConnectToRepository MyRepository.Project.SetCurrentProject(1) AModel cModel AModel = MyRepository.Model.GetModel(21) Result1 Double Result2 Double Result1 = AModel.Reliability(100) Result2 = AModel.MeanTime ErrorMsg String AModel.SetConfidenceLevel(0.9, ConfBoundsSides_TwoSidedBoth, False, ErrorMsg) BResult1 BoundsValues BResult2 BoundsValues BResult1 = AModel.Bounds_Reliability(100) BResult2 = AModel.Bounds_MeanTime MsgBox ( & Result1 & vbNewLine & _           & BResult1.upper & vbNewLine & _            & BResult1.lower & vbNewLine) MsgBox ( & Result2 & vbNewLine & _           & BResult2.upper & vbNewLine & _            & BResult2.lower & vbNewLine) End Sub