Although there are times when I want late binding, the main reason I don't declare it to start with is because I have a macro that creates the structure for all my subs automatically from a menu selection. So all my subs declare oEE but don't do anything with it and at the end of the sub it tests to see if oEE is nothing. Because I can't count on oEE going out of scope when I want it to, I have it automatically setting oEE = Nothing before the sub ends.
Then I have another macro put in "Set oEE = EEOff()". I could have that macro put in "Dim oEE as New cls_EEOff" and "If Not oEE is Nothing Then ....." at the end of the sub, but it was just too much trouble when I created it to put the "If Not ...." at the bottom of the sub. Also by having a "Dim oEE" already in the sub, it helps remind me when I need to turn off Events.
I'm not sure I explained that adequately. If not let me know and I'll try again.
Bookmarks