Aspen Plus 10
How can I retrieve Aspen Plus Error Messages with Visual Basic?
Aspen Plus error messages are stored in a folder called PER_ERROR below the objects which they reference. For example, the messages for the overall simulation are stored as a PER_ERROR collection under Results Summary/Run Status. The PER_ERROR message collection for convergence blocks can be found under the Output section of the actual convergence block.
The attached example contains a general subroutine (CheckForErrors) that will retrieve these messages. In this example, the error messages are retrieved from a convergence block that was assigned to converge a design specification. This example was written for Aspen Plus 10.1 and Excel97.
Dim lo_ErrFolder As IHNode
Dim lc_ErrMessF As IHNodeCol
Dim ls_Error As String Dim ls_Message As String
Set lo_ErrFolder = go_Simulation.Tree.Data.Convergence.Convergence.Elements("C-1")
Set lc_ErrMessF = lo_ErrFolder.Output.PER_ERROR.Elements
Call CheckForErrors(lo_ErrFolder, lc_ErrMessF, _
Range("Status").Value = ls_Error Errors.Text = ls_Message
Range("Status").Value = ls_Error
Errors.Text = ls_Message
VB, VBA, error