Solved

Withevents

Posted on 1998-05-17
1
536 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VB6 - Convert HH:MM into Decimal 8 75
Added a column screws up code 5 78
Collapse and expand table in Word 2010 2 157
Modify Text File with Excel Macro 13 47
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

734 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