Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / COM / July 2004



Tip: Looking for answers? Try searching our database.

How to hande events from an external ActiveX?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alexander Akimov - 13 Jul 2004 13:10 GMT
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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.