-.......Continued From last post....
Coming back to our Application. The Class of it as discussed, what and wherever it is, I am not going to be allowed to do anything with ( I think ). The Application I have is an instance of it.
The only slight discrepancy with our discussions in Application is that we use the same word in the Dim line and Set line. ( According to my last ' EP pair the Dim is the Class and the Set without New for Application is the existing Instance.)
But the Word Application is all over the place ### , so the Compiler or whatever chooses appropriately in this case I expect..
_..................

Originally Posted by
Kyle123
.....
What makes you think that ThisWorkbook module and Sheet Modules are not classes? They are, they just don't need explicitly instancing since Excel does this for you. The reason that the code works in the ThisWorkbook module is because ThisWorkbook is a class (and object) therefore can subscribe to events. It won't for example work in a regular module - they aren't classes.....
I do get the point that ThisWorkbook module and Sheet Modules are class modules. I make reference to them as such frequently in this Thread. Regarding me saying “......not needing Class stuff......” – i was just not clear enough about what I meant there, Sorry. I was simply meaning that we ( you ) have finally come up with an alternative solution that no longer needs us to use a new Class Module ( Your CustomSaver and my ClassMsgBox ). I guess I miss read this

Originally Posted by
Kyle123
....Subscribing to events of the Application object (or any other object) is one of the few things that classes are actually required for in VBA since only objects can subscribe to events.....
as meaning we needed to make those new Class modules. I see now you are talking about needing Class modules in General.... regarding

Originally Posted by
Kyle123
..... It won't for example work in a regular module - they aren't classes.....
.. I had noticed that myself. I tried along the way to put
Dim WithEvents ____ As
In a Normal Code Module so as to replace
Private Sub Workbook_Open()
with a normal code so as to have the option of Setting the appapparentlyapparant__ variable at a time of my choosing. But that did not work, as you suggest.
I am not too sure why that should be the case. – I do see that the error says the Dim WithEvents must be in an Object Module. I cannot see immediately why that should be the case. I see no obvious logic to it. I also do not see what “...only objects can subscribe to events..” has to do with it. The documentation is very unclear and says it can be a class or a module. Naybe that is tryong to say it can be a Class variable or a Class module name. I thought it might be just a rule that anything to do with Events needs to be in the ThisWorksheet Module. But that does not quite tie up. For one thing our _WorkbookOpen(ByVal Wb As Workbook) is in a Class module in your first code version. . And for another this is a almost a ' EP version of the code---
This goes in the ThisWorkook Code Module
This ( which is or maybe is not ?? an Event code ) goes in a normal module
I say almost ' EP - it has the advantage of still working if inadvertently the Events had been switched off.
The last code can also be replaced with
_.....
Anyway, just out of interest.... So the final code does not need the extra class module.... and I think this is a correct Summary.
Version 1 ( Kyle ) Post # 10
Extra Class Code.
A Class was made.
A WithEvents Statement was used within that Class Module which both Dim ed A variable, app, as a type of the Class Application and then the same variable was Set ( constructed ) to / using The existing instance of Application. So in the Class module we had a variable which was Dim ed like the Application instance, and also similarly “filled” except that it was subscribed to the Events of Class Application.
In a the ThisWorkbook Code module a variable, watcher, was Dim ed to a type of our new Class. Then in simple WorbookOpen() code the variable, watcher, was Set to a New instance of our new Class. If i understand correctly the variable, watcher is not actually used at all. The Set line cause the Class to be initialised and hence at that point the Object app “exists”. This Object may than use the _WorkbookOpen(ByVal Wb As Workbook) available now to it. This is then used in a Private Sub app_WorkbookOpen(ByVal Wb As Workbook) which is in the new Class Module. Probably a better Name for watcher would be AnyVariableToSetOffTheClassInitializeAsThenTheVaraibleappCanBeUsedInThatClassModuleInAWatcherCodeInThatClassModule
Version 2 ( Last codes in posts # 21 and # 22 )
Within ThisWorkbook , with use of the WithEvents Statement, a variable , appapparently___ , is Dim ed as a Type of Class Application and at the same time subscribed to the Events of the existing instance of Application.
A simple WorkbookOpen() code in that ThisWorkbook code module Sets the variable to that of the existing instance of Application. At this point the Object variable appapparently___ “exists” ( using the term “exist” lightly
). It then has available to it the Event codes such as the one we want, _WorkbookOpen(ByVal Wb As Workbook).
A code then uses this this
Private Sub appapparently___ _WorkbookOpen(ByVal Wb As Workbook)
_.....
It begs the question why you did the first code version. My answer would probably be it was the first one I came up with. Someone of your computer substenance probably had a good reason.....
_............................
Hows about_....another way_... ?
Version 3 I could not do it, but the idea is sound: ( I think )
So theoretically I could have then done the following as yet another Alternative.
The idea was to do the Class Module idea more normally, just as a nice learning excessive to wrap the Thread up..
I add a new Class Module. The Class is to be that to use to create an Object which is like the Application instance but has the subscription to the Events of Class Application.
So the Code in ThisWorkbook, which I guess I may be doing correctly.
ClassMsgBox2 is intended to be the class needed to create an Object which is similar to the Application Instance of Application.
A Variable, TellYouYouOpenedAWorkbook, is Dim ed and
On Opening the Workbook an instance of the Object is created with the variable name , TellYouYouOpenedAWorkbook
This variable uses then the _WorkbookOpen(ByVal Wb As Workbook) to give a message box when a Workbook is opened.
The Class Module I think ( know ) I got wrong
.. But I think you get the general idea is sound
Class module ClassMsgBox2
_.. I was so close again 
_......................

Originally Posted by
Kyle123
...Thought you had it Alan, you were so close ...
- Story of my life
_....But sometimes I get lucky and someone of your great substenance shows me and explains clearly what is going on 
Wether i got there or not, i am certzainly a bit wiser, ( or less dumb ! )
Thanks
Alan
P.s.
Sorry I missed the point as well about the code break in a class module_.... I found it after what you said
In VB Editor ---
_ ---Tools --- Options --- General --- Select radio button “in ClassModule” 
_.. Thanks, that one had bugged me for a while – I had asked a few times elsewhere,
Bookmarks