Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Events, Class Modules and Addins ... oh my!
Maybe I have bitten off more then I can chew but I would really like to
get this where I want it to go. I have an XLA addin I created. Works great (thanks to much help from this board). I can now give this XLA file to anyone in my team that needs it, to give them the functions. But I am trying to ALSO make this addin, automatically create a toolbar icon, linked to the function I created. This seems to have brought me into the world of Class Modules and Events... a world I know little about, yet. Part of my troubles (outside of not understanding the whole process) I believe is that most examples I have seen are linked to a specific workbook. My process will need to be run on hundreds of workbooks, therefore I want it to all be 'application level'. The functions all work now on any workbook I open, but I simply cannot get even a msgbox to pop up when I open a new or existing workbook. Could some kind soul, give me some example code of how to do this? Keep in mind the moment you tell me "just create a workbook open event", you have lost me. TIA |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Events, Class Modules and Addins ... oh my!
But I am trying to ALSO make this addin, automatically create a toolbar
icon, linked to the function I created. executing a macro from a commandbar button doesn't require a class module. You have the open event (for the Addin) in the addin create the commandbar and assign its button to a macro in your addin. Destroy the button when you close the addin using the BeforeClose event. Also, it doesn't require application level events. http://msdn.microsoft.com/library/de...ce04042002.asp the two events I spoke of are workbook level events of the Addin http://www.cpearson.com/excel/events.htm (this is different than what Jake suggested). It is true that Thisworkbook module is a class module, but it is predefined and always available. It requires little more than selecting events from the dropdowns at the top, then adding your code to the declaration provided. -- Regards, Tom Ogilvy wrote in message oups.com... Maybe I have bitten off more then I can chew but I would really like to get this where I want it to go. I have an XLA addin I created. Works great (thanks to much help from this board). I can now give this XLA file to anyone in my team that needs it, to give them the functions. But I am trying to ALSO make this addin, automatically create a toolbar icon, linked to the function I created. This seems to have brought me into the world of Class Modules and Events... a world I know little about, yet. Part of my troubles (outside of not understanding the whole process) I believe is that most examples I have seen are linked to a specific workbook. My process will need to be run on hundreds of workbooks, therefore I want it to all be 'application level'. The functions all work now on any workbook I open, but I simply cannot get even a msgbox to pop up when I open a new or existing workbook. Could some kind soul, give me some example code of how to do this? Keep in mind the moment you tell me "just create a workbook open event", you have lost me. TIA |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Basic question - modules and class modules - what's the difference? | Excel Programming | |||
Class Modules | Excel Programming | |||
Class Modules | Excel Programming | |||
Class modules | Excel Programming | |||
Class Modules vs Modules | Excel Programming |