Does anyone use CodeJock activeX

diddi

Well-known Member
Joined
May 20, 2004
Messages
3,337
Office Version
  1. 2010
Platform
  1. Windows
greets all. i am trying to use a third party .ocx on a form and when i reference it in a Class module it errors because i dont know what to put in front of "PushButton"

normal version...
Code:
Public WithEvents allButtons As MSForms.CommandButton

all good.

new version...
Code:
Public WithEvents allButtons As PushButton
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Have you searched the Object Browser for PushButton to see what library it belongs to?
 
Upvote 0
thx Norie, heres the code now. no error, but class not invoked on pushbutton_click

Code:
Sub MyForm()
    Dim myButtons() As New Class1
    With Me
        ReDim myButtons(0 To .Controls.Count - 1)
        For i = 0 To .Controls.Count - 1
            If Left(.Controls(i).Name, 10) = "PushButton" Then
                Set myButtons(i).allButtons = Me.Controls(i)
            End If
        Next i
    End With



class module:   class1....

Public WithEvents allButtons As XtremeSuiteControls.PushButton

Private Sub allButtons_Click()
    MsgBox (Val(Mid$(allButtons.Name, 11)))
End Sub
 
Upvote 0
Re: Does anyone use CodeJock activeX -Solved

got it! wrong scope for variable. for interested parties: should work with any thrd party .ocx

thx Norie. I will use the object browser next time :)

Code:
Dim myButtons() As New Class1

Sub MyForm()
    With Me
        ReDim myButtons(0 To .Controls.Count - 1)
        For i = 0 To .Controls.Count - 1
            If Left(.Controls(i).Name, 10) = "PushButton" Then
                Set myButtons(i).allButtons = Me.Controls(i)
            End If
        Next i
    End With


My class module: class1....
Code:
Public WithEvents allButtons As XtremeSuiteControls.PushButton

Private Sub allButtons_Click()
    MsgBox (Val(Mid$(allButtons.Name, 11)))
End Sub
 
Upvote 0
Re: Does anyone use CodeJock activeX -Solved

diddi

Glad you got the answer.:)

Where did you find this 'PushButton' control? I searched the CodeJock site and couldn't find it.:eek:
 
Upvote 0

Forum statistics

Threads
1,224,574
Messages
6,179,628
Members
452,933
Latest member
patv

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top