
Customization FAQ A-9
A-9
If HYSYS is not running, then the above line generates error
number 429 in Office 97 and 483 in Office 95. Error trapping
can be used to catch the error and determine if HYSYS is
running. For example:
16. How do I make HYSYS visible when accessing it via
Automation?
Ans: By default, when HYSYS or a HYSYS simulation case is
opened using Automation, it is a hidden process, with only
the HYSYS splash screen indicating that HYSYS is running.
The Visible Boolean property, available in both the
Application and SimulationCase objects is used to make
HYSYS visible to the user.
For example,
On Error GoTo ErrorTrap
Set hyApp = GetObject(, "HYSYS.Application")
'{Code here which will be executed only If HYSYS Is running}
Exit Sub
ErrorTrap:
If Err.Number = 429 Or Err.Number = 483 Then
MsgBox "HYSYS Is Not currently running, please start HYSYS."
Else
MsgBox "The following Error occurred: " & Err.Description
End If
hyCase.Visible = True
where:
hyCase = an object reference to HYSYS or a HYSYS
simulation case.
Komentáře k této Příručce