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!

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
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
Basic question - modules and class modules - what's the difference? Mark Stephens[_3_] Excel Programming 9 May 8th 05 11:48 AM
Class Modules Pavlos Excel Programming 5 January 19th 05 05:31 PM
Class Modules mark Excel Programming 7 April 14th 04 10:10 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 03:02 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"