Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Events, Class Modules and Addins ... oh my! [email protected] Excel Programming 2 August 1st 06 02:18 AM
Basic question - modules and class modules - what's the difference? Mark Stephens[_3_] Excel Programming 9 May 8th 05 11:48 AM
Class Modules ibeetb Excel Programming 1 January 5th 04 10:04 PM
Class modules pk Excel Programming 2 October 3rd 03 03:45 AM
Class Modules vs Modules Jeff Marshall Excel Programming 2 September 28th 03 07:57 PM


All times are GMT +1. The time now is 12:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"