
When using the above ActiveX forms on Excel version 2502, Build 16.0.18526.20044 with the below VBA code, it gives a 429 error (ActiveX component can't create object), but it works without issue on version 2412 Build 16.0.18324.20240.
Private Sub CaseBox_GotFocus()
'Link to Simulation
If Me.Range("SimTypeC") = "HYSYS" Then
Dim hyAppH As HYSYS.Application
Set hyAppH = CreateObject("HYSYS.application")
hyAppH.Visible = True
Else
Dim hyAppU As UniSimDesign.Application
Set hyAppU = CreateObject("UniSimDesign.application")
hyAppU.Visible = True
End If
'Get all the cases in the open application
If Me.Range("SimTypeC") = "HYSYS" Then
Dim hyCaseH As HYSYS.SimulationCase
i = 1
j = hyAppH.SimulationCases.Count
ReDim caselist(i To j) As String
For Each hyCaseH In hyAppH.SimulationCases
caselist(i) = hyCaseH.Title
i = i + 1
Next
Else
Dim hyCaseU As UniSimDesign.SimulationCase
i = 1
j = hyAppU.SimulationCases.Count
ReDim caselist(i To j) As String
For Each hyCaseU In hyAppU.SimulationCases
caselist(i) = hyCaseU.Title
i = i + 1
Next
End If
With Me.CaseBox
.Clear
.List = caselist
End With
End Sub
Is there a bug with ActiveX in the latest version, or is support removed for ActiveX?