add-in procedures called from active workbook events

D

doco

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
 
G

Guest

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
(e-mail address removed)
http://www.vonixx.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top