How to assign an event to multiple objects with excel vba?
I have ten drop down menus on a worksheet each of which should respond the same to the `GotFocus()` event. 

I have written the following code but I get a run time error (459) - *"Object or class does not support the set if events"*

In a class called `clsPDRinput` I have the following:

    Dim tbCollection As Collection
    Public WithEvents inputObj As OLEObject
    
    Public Property Set myInput(obj As OLEObject)
        Set inputObj = obj
    End Property
    
    Public Sub tbPDRInput_GotFocus()
        //Do some stuff...
    End Sub

I am then running the following code which is producing the error:

    Public Sub InitializePDRInput()
        Dim myObj As OLEObject
        Dim obj As clsPDRInput
    
        Set tbCollection = New Collection
            For Each myObj In Worksheets("1. PDR Documentation").OLEObjects
                If TypeName(myObj.Object) = "ComboBox" Then
                    Set obj = New clsPDRInput
                    Set obj.myInput = myObj <-- **THIS LINE THROWS ERROR**
                    tbCollection.Add obj
                End If
            Next inputObj
        Set obj = Nothing
    End Sub

I am not sure what is causing this error. One though I had is that `OLEObject` is too generic and not every `OLEObject` supports the `GotFocus()` event and that is why the code is giving the error message?

I have tried replacing `OLEObject` with `MSForms.ComboBox` but that doesn't resolve issue.

Any ideas - have googled for two hours now and come up blank...
How to assign an event to multiple objects with excel vba?
===

I have ten drop down menus on a worksheet each of which should respond the same to the `GotFocus()` event. 

I have written the following code but I get a run time error (459) - *"Object or class does not support the set if events"*

In a class called `clsPDRinput` I have the following:

    Dim tbCollection As Collection
    Public WithEvents inputObj As OLEObject
    
    Public Property Set myInput(obj As OLEObject)
        Set inputObj = obj
    End Property
    
    Public Sub tbPDRInput_GotFocus()
        //Do some stuff...
    End Sub

I am then running the following code which is producing the error:

    Public Sub InitializePDRInput()
        Dim myObj As OLEObject
        Dim obj As clsPDRInput
    
        Set tbCollection = New Collection
            For Each myObj In Worksheets("1. PDR Documentation").OLEObjects
                If TypeName(myObj.Object) = "ComboBox" Then
                    Set obj = New clsPDRInput
                    Set obj.myInput = myObj <-- **THIS LINE THROWS ERROR**
                    tbCollection.Add obj
                End If
            Next inputObj
        Set obj = Nothing
    End Sub

I am not sure what is causing this error. One though I had is that `OLEObject` is too generic and not every `OLEObject` supports the `GotFocus()` event and that is why the code is giving the error message?

I have tried replacing `OLEObject` with `MSForms.ComboBox` but that doesn't resolve issue.

Any ideas - have googled for two hours now and come up blank...