Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Events, Class Modules and Addins ... oh my!
Some more follow up on this, as I still don't seem to be getting my
question answered. (I am sure its my fault for not explaining properly). For example I got one response from Jake Marx suggestion to look at Chip Pearson's tutorial. This I had already done, and have even used the APPEVENT.xls file. But from what I can tell, the triggers on the APPEVENT.xls file, will do exactly what I want, except for one small problem... They only work, when APPEVENT is open. I want this to fire whenever I open any file, without having to pre modify each file, and without having to open APPEVENT. How do I get this functionality at a application level not a file level. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Events, Class Modules and Addins ... oh my!
You use one file to instantiate application level events.
this would be your addin. The appevent.xls file is a demonstration download. You would place similar code in your addin. When you addin is loaded, then applicationl level events are instantiated. However, you seem to want to ignore the fact that for your stated purpose, of putting an ["icon" on the menu], you don't need application level events. Jake was responding to what you said which sounded like application level events. If you want something other than the "icon", then perhaps they are appropriate. If so, I have provided the information you need to continue. -- Regards, Tom Ogilvy " wrote: Some more follow up on this, as I still don't seem to be getting my question answered. (I am sure its my fault for not explaining properly). For example I got one response from Jake Marx suggestion to look at Chip Pearson's tutorial. This I had already done, and have even used the APPEVENT.xls file. But from what I can tell, the triggers on the APPEVENT.xls file, will do exactly what I want, except for one small problem... They only work, when APPEVENT is open. I want this to fire whenever I open any file, without having to pre modify each file, and without having to open APPEVENT. How do I get this functionality at a application level not a file level. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Events, Class Modules and Addins ... oh my!
Okay I will try working with all that some more, and yes it is more the
just placing an icon, I have tried earlier placed that code into my addin, but the moment I do that its doesn't function at all. It seems to need to have some code in the ThisWorkBook module, which appears to me to be unique for every workbook. Thanks for you help. Tom Ogilvy wrote: You use one file to instantiate application level events. this would be your addin. The appevent.xls file is a demonstration download. You would place similar code in your addin. When you addin is loaded, then applicationl level events are instantiated. However, you seem to want to ignore the fact that for your stated purpose, of putting an ["icon" on the menu], you don't need application level events. Jake was responding to what you said which sounded like application level events. If you want something other than the "icon", then perhaps they are appropriate. If so, I have provided the information you need to continue. -- Regards, Tom Ogilvy " wrote: Some more follow up on this, as I still don't seem to be getting my question answered. (I am sure its my fault for not explaining properly). For example I got one response from Jake Marx suggestion to look at Chip Pearson's tutorial. This I had already done, and have even used the APPEVENT.xls file. But from what I can tell, the triggers on the APPEVENT.xls file, will do exactly what I want, except for one small problem... They only work, when APPEVENT is open. I want this to fire whenever I open any file, without having to pre modify each file, and without having to open APPEVENT. How do I get this functionality at a application level not a file level. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Events, Class Modules and Addins ... oh my!
Oh one last question, I am still fuzzy, on this. How would you add an
icon on the toolbar, when ANY workbook is opened without an application level event? I see how I can do it on the Workbook level if it was for a specific workbook, but for any workbook I don't seem to be able to make this happen. Sorry if I am just missing something simple, it is just not clicking for me... yet. Tom Ogilvy wrote: You use one file to instantiate application level events. this would be your addin. The appevent.xls file is a demonstration download. You would place similar code in your addin. When you addin is loaded, then applicationl level events are instantiated. However, you seem to want to ignore the fact that for your stated purpose, of putting an ["icon" on the menu], you don't need application level events. Jake was responding to what you said which sounded like application level events. If you want something other than the "icon", then perhaps they are appropriate. If so, I have provided the information you need to continue. -- Regards, Tom Ogilvy " wrote: Some more follow up on this, as I still don't seem to be getting my question answered. (I am sure its my fault for not explaining properly). For example I got one response from Jake Marx suggestion to look at Chip Pearson's tutorial. This I had already done, and have even used the APPEVENT.xls file. But from what I can tell, the triggers on the APPEVENT.xls file, will do exactly what I want, except for one small problem... They only work, when APPEVENT is open. I want this to fire whenever I open any file, without having to pre modify each file, and without having to open APPEVENT. How do I get this functionality at a application level not a file level. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Events, Class Modules and Addins ... oh my!
Toolbars/menus are application level, not workbook level. When your addin
loads, it can be set up to place the button on the toolbar. Any open workbook or any workbook subsequently opened would also see that button. When the button is pressed, it would run code contained in your addin. That code could be designed to operate on the currently active workbook. Your addin is loaded when excel is started up if the user chooses it under Tools=Addins (the standard scenario) or you place it in the xlStart folder. So yes, ThisWorkbook is unique to each workbook. Its purpose is to run code when the workbook is opened (or in this case, when the addin is loaded). However, the code that runs can do things which are applicable to all workbooks. so running code from the Thisworkbook module of your addin could do things like 1) add a commandbarbutton to an existing menu or toolbar and assign a macro from the addin to the commandbarbutton 2) remove the commandbarbutton when the addin is closed so you don't get multiple buttons when it is loaded again 3) instantiate application level events and provide the code they will execute Perhaps this tutorial on distributing applications by JK Pieterse will help: http://www.jkp-ads.com/Articles/DistributeMacro00.htm [Note: "ads" in the above doesn't mean advertisments] -- Regards, Tom Ogilvy " wrote: Oh one last question, I am still fuzzy, on this. How would you add an icon on the toolbar, when ANY workbook is opened without an application level event? I see how I can do it on the Workbook level if it was for a specific workbook, but for any workbook I don't seem to be able to make this happen. Sorry if I am just missing something simple, it is just not clicking for me... yet. Tom Ogilvy wrote: You use one file to instantiate application level events. this would be your addin. The appevent.xls file is a demonstration download. You would place similar code in your addin. When you addin is loaded, then applicationl level events are instantiated. However, you seem to want to ignore the fact that for your stated purpose, of putting an ["icon" on the menu], you don't need application level events. Jake was responding to what you said which sounded like application level events. If you want something other than the "icon", then perhaps they are appropriate. If so, I have provided the information you need to continue. -- Regards, Tom Ogilvy " wrote: Some more follow up on this, as I still don't seem to be getting my question answered. (I am sure its my fault for not explaining properly). For example I got one response from Jake Marx suggestion to look at Chip Pearson's tutorial. This I had already done, and have even used the APPEVENT.xls file. But from what I can tell, the triggers on the APPEVENT.xls file, will do exactly what I want, except for one small problem... They only work, when APPEVENT is open. I want this to fire whenever I open any file, without having to pre modify each file, and without having to open APPEVENT. How do I get this functionality at a application level not a file level. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Events, Class Modules and Addins ... oh my! | Excel Programming | |||
Basic question - modules and class modules - what's the difference? | Excel Programming | |||
Class Modules | Excel Programming | |||
Class modules | Excel Programming | |||
Class Modules vs Modules | Excel Programming |