Enable/Disable Excel Add-Ins using VBA

BilboBaggins

New Member
Joined
Jun 3, 2014
Messages
4
Hello MrExcel forum members,

I am trying to enable and disable Excel's Add-Ins using VBA. I originally had code that searched through the Excel file and grabbed the names of the Add-Ins from cells in the spreadsheet and uninstalled them. That wasn't working, so I tried using a simpler method:

Code:
Sub DisableAddIn()


AddIns("My_addin_1").Installed = False
AddIns("My_addin_2").Installed = False
AddIns("My_addin_3").Installed = False
AddIns("My_addin_4").Installed = False
AddIns("My_addin_5").Installed = False
AddIns("My_addin_6").Installed = False
AddIns("My_addin_7").Installed = False


End Sub
There is a similar piece of code that I use for enabling the add-ins.

The problem is that the code doesn't disable all the add-ins at once. In fact, I have to run the VB code several times to disable (or enable) all the add-ins. In other words, I will run the code, open up the Add-Ins dialogue box, and note that only one of the checkboxes is unchecked. It takes multiple runs of the VBA program to successfully enable/disable all the Add-Ins.

I've been googling and searching the forums for the better part of a work day, and I'm getting fed up. Does anyone have experience with this problem?

Thanks,

Bilbo

EDIT: I am in Excel 2010, Windows 7
 
Last edited:

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
SOLVED! I haven't discovered why the above method doesn't work, but I just basically ran some Do... While Loops on each one of these to solve the problem, e.g.

Code:
Do While AddIns([COLOR=#333333]"My_addin_1"[/COLOR]).Installed = True


    AddIns([COLOR=#333333]"My_addin_1"[/COLOR]).Installed = False


Loop

And so forth for each of the Add-Ins. It works well, no hiccups. If anyone knows why the first method I tried doesn't work, let me know. I'd be interested to hear.

Thanks!
 
Upvote 0
Hi BilboBaggins,

My requirements are mostly similar. I have Sample.xlsm file and I want to run a vba which should find all available Add-ins for excel and disable/False them when Sample.xlsm will load.

As you said
I originally had code that searched through the Excel file and grabbed the names of the Add-Ins from cells in the spreadsheet and uninstalled them.
Can you please share the same with me.
Thanks in Advance.

PritishS
 
Upvote 0

Forum statistics

Threads
1,214,599
Messages
6,120,447
Members
448,966
Latest member
DannyC96

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