VBA add-in subscription list for App level events -


i creating excel add-in (.xlam) needs selectively respond workbook/worksheet events, in open workbooks (user may have multiple workbooks open). dont want go down road of pasting code other open workbook's thisworkbook modules.

i user able select whether add-in respond active workbook's events.

what appropriate solution achieve this?

currently, thinking of solution looks this:

enable add-in listen application level events via cls_appevents class (cls_appevents instantiated on workbook_open()).

when user clicks button, add activeworkbook.name array of stings. when user clicks button again, remove 'activeworkbook.name` array.(this need dynamic array - there better option?)

when application-level tableupdate (for example) event fires, check array of workbook names see if contains workbook's name event originated. if so, call whatever function.


Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

ios - Change Storyboard View using Seague -

verilog - Systemverilog dynamic casting issues -