+ Reply to Thread
Results 1 to 3 of 3

add-in procedures called from active workbook events

  1. #1
    doco
    Guest

    add-in procedures called from active workbook events

    I have a procedure I wish to place into an add-in - simple enough done.
    However, when this add-in is instaced I want this procedure to be called
    from *any active* workbooks' Workbook_SheetSelectionChange(ByVal Sh As
    Object, ByVal Target As Range) event. How is this done?

    TIA
    doco



  2. #2
    Edwin Tam
    Guest

    RE: add-in procedures called from active workbook events

    The syntax for calling a macro in another file (no matter xls or xla) is:
    Application.Run Macro:="'file_name'!macro_name"

    But you won't be able to call the "Workbook_SheetSelectionChange". You
    probably need to pull the code onto a separate Sub in a module. Or, you can
    use a Sub in a module which executes the "Workbook_SheetSelectionChange".

    Regards,
    Edwin Tam
    [email protected]
    http://www.vonixx.com






    "doco" wrote:

    > I have a procedure I wish to place into an add-in - simple enough done.
    > However, when this add-in is instaced I want this procedure to be called
    > from *any active* workbooks' Workbook_SheetSelectionChange(ByVal Sh As
    > Object, ByVal Target As Range) event. How is this done?
    >
    > TIA
    > doco
    >
    >
    >


  3. #3
    John Green
    Guest

    Re: add-in procedures called from active workbook events

    You want to trap Application events. This can be done using a class module.
    The procedure is outlined on Chip Pearson's website:

    http://cpearson.com/excel/AppEvent.htm

    John Green

    "doco" <[email protected]> wrote in message
    news:%[email protected]...
    >I have a procedure I wish to place into an add-in - simple enough done.
    >However, when this add-in is instaced I want this procedure to be called
    >from *any active* workbooks' Workbook_SheetSelectionChange(ByVal Sh As
    >Object, ByVal Target As Range) event. How is this done?
    >
    > TIA
    > doco
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1