Re: CONCLUSION: No one knows about EVENT CLASS proccedures


Posted by JohnG on February 01, 2002 5:45 AM

Continuation of
18985.html

SheetChange event is not working? I have a BeforeClose and BeforeSave events and they are fine set up as new class events. Below is an extract of the code I am using.These are new class events so that they works on any workbook that is open not just the one they are in.

--In AppEventClass
Public WithEvents Appl As Application

Private Sub Appl_Workbook_SheetChange(ByVal Sh As
Object, ByVal Source As Range)

Dim ApplicationClass As New AppEventClass ' Creates variable to be used to activate events.

--In Thisworkbook
Private Sub Workbook_Open()
Set ApplicationClass.Appl = Application 'Actives all events created in AppEventClass.
End Sub

Posted by JohnG on February 01, 2002 7:11 AM

Found the answer

It will accept
Private Sub Appl_SheetChange(ByVal Sh As Object, ByVal Source As Range)

instead of
Private Sub Appl_Workbook_SheetChange(ByVal Sh As Object, ByVal Source As Range)



Posted by Ivan F Moala on February 01, 2002 12:33 PM

This is exactly what we were telling you ?! through 3 posts