"AddItem" Method missing from Drop Down Menu

Oscar Roark 21 Reputation points
2021-03-19T22:04:43.53+00:00

We have a problem in VBA code that is running in GE iFix Version 6.1 on Windows Server 2016. The code itself was imported from a previous install using iFix version 5.8 and has been running without a problem for years. The code itself doesn't seem to be the problem. The problem began when a new hard drive was installed and the operating system and software had to be reloaded. Now when the Picture containing the code is called we get 'Run-time Error '438': Object doesn't support the property or method' When we run the debugger the line ComboBox21.AddItem "Sunday" is highlighted. If we delete ".AddItem" and reenter the "." the method or property drop-down box appears but "AddItem" is not an available option. The other selections are still available but AddItem is missing. We have tried installing Microsoft Office 2013 and reinstalling GE iFix. Does anybody have any ideas? Private Sub CFixPicture_Initialize() user.varPreviousPicture.CurrentValue = user.varCurrentPicture.CurrentValue user.varCurrentPicture.CurrentValue = Me.Name ComboBox21.AddItem "Sunday" ComboBox21.AddItem "Monday" ComboBox21.AddItem "Tuesday" ComboBox21.AddItem "Wednesday" ComboBox21.AddItem "Thursday" ComboBox21.AddItem "Friday" ComboBox21.AddItem "Saturday" ComboBox21.AddItem "Disabled" End Sub

{count} votes

Accepted answer
  1. Hung-Chun Yu 976 Reputation points Microsoft Employee
    2021-03-21T08:50:13.033+00:00

    Hi Oscar

    Check out the following post from GE https://www.ge.com/digital/documentation/ifix/version61/Subsystems/IPIiFIX/content/ipi_notes.htm

    In particular following section

    Supporting VBA 6.5 After an Upgrade
    In VBA 6.5, certain event parameter data types are interpreted differently than in earlier VBA version. For instance, one of these data types is the VBA ErrObject. The VisiconX Data Control uses the ErrObject data type in two of its events.

    If a picture created with an earlier version of iFIX contains a VisiconX Data Control, and also contains VBA 5.5 scripts added for the VisiconX Data Control's ErrorOccurred event or ExecuteComplete event, when the picture is opened in iFIX 6.1, it will generate a compiler error indicating an invalid character '_'.

    This occurs because the ErrObject in VBA 5.5 is declared as type "VBA._ErrObject", and in VBA 6.5, it is declared simply as "ErrObject".

    To correct the compiler problem and make the scripts function correctly, make the following changes to the event declarations:

    iFIX 2.21 and earlier with VBA 5.5:

    Private Sub vxData1_ErrorOccurred(pError As VBA._ErrObject)
    End Sub

    iFIX 6.1 with VBA 6.5:

    Private Sub vxData1_ErrorOccurred(pError As ErrObject)
    End Sub

    iFIX 2.21 and earlier with VBA 5.5:

    Private Sub vxData1_ExecuteComplete(pStatus As VBA._ErrObject, sQuery As String)
    End Sub

    iFIX 6.1 with VBA 6.35:

    Private Sub vxData1_ExecuteComplete(pStatus As ErrObject, sQuery As String)
    End Sub

    NOTE: This problem may occur with other ActiveX controls and data types that GE has not directly encountered. If you see problems, you should insert the control into a new picture, go to the VBA Editor, and examine the syntax used to declare events for the control in the new picture. Use the information provided in this section to edit the event declarations in the existing picture.

    1 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Oscar Roark 21 Reputation points
    2021-03-20T23:36:31.38+00:00

    I have made some progress in resolving the issue I have described. This is what I have found so far:

    1. ComboBox21 in the above code is an ActiveX control.
    2. The AddItem method that was previously part of that ActiveX control has either been removed or is hidden. There were no changes made to the code to make that happen thus I have to assume the original installation source code has been damaged or something else occurred.
    3. The Properties option is greyed out for that ActiveX control thus I can't determine whether I can re-add AddItem to the control. The original developer of the code may have protected it to prevent modifications.
    4. Hiding or Unhiding the AddItem method doesn't have any effect on the code execution.
    0 comments No comments

  2. OssieMac 411 Reputation points
    2021-03-22T05:03:21.047+00:00

    @Oscar Roark ,

    Have you tried deleting the ComboBox and re-creating it and see if the code works?

    0 comments No comments