Solved

Withevents

Posted on 1998-05-17
1
533 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

820 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