I am delving into class modules in VBA. I have code to initialize my class when documents open etc... when I debug or feel the urge to reset the project the class shuts down.
So, in a nutshell, I would like to know how to restart the class after the project has been reset. Conceptually, this is what I have:
Public pub_myObject As New clsDrTribos
' using 'As New' causes auto instantiate
End ' End resets the project (same as pressing the 'stop' button)
End Sub 'ResetProject
But, the class does not actually start working until I have some other code running to invoke it...
' Since I am using an auto instantiate an object based on my class is kind of waiting, dormant,
' ready to start working. But it doesn't work.
' However, simply looking at pub_myObject causes it to become something & it starts working:
If pub_myObject is Nothing then
End Sub 'SomeRandomSub
My problem is that I absolutely need the class to be something as soon as my project is reset - is this possible?
I tried searching for code that runs after resetting a VBA project but, if the answer is out there I couldn't find it.