I need to handle events from ActiveX. If this ActiveX is on form, I just
create Subroutine with the object name, the underscore and the event name,
and all works :
Private Sub PivotTable1_OnDisconnect()
MsgBox "OnDisconnect"
End Sub
But if I only get reference (look below) to ActiveX from outside, what
should I do?
Dim ptable As Object
Public Sub SetPivotTable(a_ptable As Object)
Set ptable = a_ptable
LabelText.Caption = ptable.Version
End Sub
Thanks in advance, Alexander.
Jens Neuhalfen - 30 Jul 2004 16:29 GMT
Hi Alexander,
> I need to handle events from ActiveX. If this ActiveX is on form, I just
> create Subroutine with the object name, the underscore and the event
[quoted text clipped - 13 lines]
> LabelText.Caption = ptable.Version
> End Sub
Try this
private WithEvents ptable As PivotTable
Public Sub SetPivotTable(a_ptable As Object)
Set ptable = a_ptable
LabelText.Caption = ptable.Version
End Sub
Private Sub ptable_OnDisconnect()
MsgBox "OnDisconnect"
End Sub
Jens
> Thanks in advance, Alexander.