Add-in macro to run when certain workbooks are opened

kirk9992

New Member
Joined
Aug 11, 2010
Messages
8
I have a set of workbooks that are very similair in function but for different groups so they must be kept separate. I have written a few macros to streamline a few tasks when working with this set of workbooks. Origninally I had the macros in each workbook individually, but this became inconvinient when a bug was found or a change was needed. The macros in each workbook had to be modified individually. So I decided to create an add-in that would contain all of my macros in one place. My problem is that I only want this particular add-in to be available when certain workbooks (the workbooks in my special set) are opened.

For example, lets say I am working in a new workbook that was created when I just open Excel, it is called "Book1". When working with Book1 I don't want my add-in to be available, but if while Book1 is still open I open one of my workbooks from the set that does use the add-in I want Excel to recognize that and make the add-in available.

I hope that is clear. I would rather not have any macros in the set of workbooks because it is more convinient if they are .xlsx files.

Thanks in advance.

Curtis
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
i recommand you to make a vba module and put all the codes there. and don't forget to refer to the sheets in vba which you want to apply.
in addition, don't forget to clean the module periodically since the module grow bigger even time you call a macro from it.
 
Upvote 0
I have several modules and a few userforms. That is why I want to make an add in. It gets very messy trying to keep everything up to date when I find a bug or need to make a tweak if all of the modules and userforms are in every workbook (I have 8 that these modules and userforms apply to). It is 8 different workbooks each of which contain 20 to 100 sheets. I have the modules and userforms functional. I just want them in a single location, ie the add in, and I only want the add in enabled if one of the 8 workbooks is opened.

Thanks

Curtis
 
Upvote 0

Forum statistics

Threads
1,216,225
Messages
6,129,601
Members
449,520
Latest member
TBFrieds

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top