Solved

Withevents

Posted on 1998-05-17
1
528 Views
Last Modified: 2008-03-10
If I skip the Event RenameNode row I get the error message Object does not source Automation events. Why is this row necessary?

==form code (a form with a treeview)
Option Explicit

Dim WithEvents urban As nisse

Private Sub Form_Load()
     Set urban = New nisse
     urban.init TreeView1
End Sub

=class code
Option Explicit

Private WithEvents TV As ComctlLib.treeview
?Event RenameNode(Data As Variant, NewName As String, Cancel As Integer)

Sub init(treeview As ComctlLib.treeview)
    Set TV = treeview
End Sub
Private Sub TV_Click()
    MsgBox "hej"
End Sub
0
Comment
Question by:manne
1 Comment
 
LVL 1

Accepted Solution

by:
johnny_5 earned 50 total points
ID: 1451901
The class must source an event for it to be an "Object which sources Automation events"  I ran into the same problem and thought it was pretty stupid.  Create another event, like

Event Fubar()

and then comment out your event RenameNode event and you shouldn't get the error.  

SHOULD work! :)

0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now