sbendbuckeye
Active Member
- Joined
- Nov 26, 2003
- Messages
- 440
Hello all,
We are working on a generic custom command bar which could conceivably be used in multiple places over time. Right now it consists of a class to define the ToolBars and a module to handle the OnAction events of the same.
I would like to instantiate the class in the module with the OnAction code by using Autpen and Auto_Close instead of instantiating it in the Workbook_Open and Workbook_BeforeClose events. This does at least 3 things:
A. It gives me a reference to the class in the standard module in case I need to interact with it from the OnAction methods
B. The implementation is cleaner because I don't need to mess with ThisWorkBook code, I can just import the class and module noted above
C. It allows for better encapsulation because all of the code is in the same two places every time
The only events I'm worried about in the class are Workbook New, Activate and Deactivate so I can hide/unhide the ToolBar as appropriate. Does anyone see a problem with this approach? In this context I believe that these methods should be interchangable with each other, but I wanted to check with the gurus to make sure I wasn't missing something.
Thanks in advance for any ideas and/or suggestions!
We are working on a generic custom command bar which could conceivably be used in multiple places over time. Right now it consists of a class to define the ToolBars and a module to handle the OnAction events of the same.
I would like to instantiate the class in the module with the OnAction code by using Autpen and Auto_Close instead of instantiating it in the Workbook_Open and Workbook_BeforeClose events. This does at least 3 things:
A. It gives me a reference to the class in the standard module in case I need to interact with it from the OnAction methods
B. The implementation is cleaner because I don't need to mess with ThisWorkBook code, I can just import the class and module noted above
C. It allows for better encapsulation because all of the code is in the same two places every time
The only events I'm worried about in the class are Workbook New, Activate and Deactivate so I can hide/unhide the ToolBar as appropriate. Does anyone see a problem with this approach? In this context I believe that these methods should be interchangable with each other, but I wanted to check with the gurus to make sure I wasn't missing something.
Thanks in advance for any ideas and/or suggestions!