Disable all Add ins at excel startup

PritishS

Board Regular
Joined
Dec 29, 2015
Messages
119
Office Version
  1. 2007
Platform
  1. Windows
Dear Sir/Madam,
Greetings!!

I have been looking for the solutions for last 2 days and spent almost 36 hrs on my laptop..:p. But no luck.

Requirements:

1. I have a file named PROJECT.xlsm
2. In my system I have few Add-ins (both COM Add in and Excel Add in) like RDB Merge, Nitro PDF Pro etc.
3. I don't want to load any Available Add-ins when I start this PROJECT.xlsm file.
4. Also When I will close that file, all Add-ins will be available for other Excel files.
5. I have achieved the same using code at Workbook_Open and Workbook_BeforeClose event as follows

Workbook_Open Event:

Code:
Private Sub Workbook_Open() 
Do While AddIns("RDBMerge Add-in").Installed = True


AddIns("RDBMerge Add-in").Installed = False


Loop


Do While Application.COMAddIns("TFCOfficeShim.Connect.3").Connect = True
Application.COMAddIns("TFCOfficeShim.Connect.3").Connect = False
Loop


Do While Application.COMAddIns("DeTong.KTELoader").Connect = True
Application.COMAddIns("DeTong.KTELoader").Connect = False
Loop


Do While Application.COMAddIns("DeTong.KTEHelper").Connect = True
Application.COMAddIns("DeTong.KTEHelper").Connect = False
Loop


End Sub

Workbook_BeforeClose event:

Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean) 
Do While AddIns("RDBMerge Add-in").Installed = False


AddIns("RDBMerge Add-in").Installed = True


Loop


Do While Application.COMAddIns("TFCOfficeShim.Connect.3").Connect = False
Application.COMAddIns("TFCOfficeShim.Connect.3").Connect = True
Loop


Do While Application.COMAddIns("DeTong.KTELoader").Connect = False
Application.COMAddIns("DeTong.KTELoader").Connect = True
Loop


Do While Application.COMAddIns("DeTong.KTEHelper").Connect = False
Application.COMAddIns("DeTong.KTEHelper").Connect = True
Loop


End Sub

This works fine for anyone if you know which particular COM Addin or Excel Addin you want to block.

BUT My question: Is there any method do block all add in without mentioning it's name at Workbook_Open and re-activate them after closing my PROJECT.xlsm?

I have another code which finds out how many COM Addi ns or Excel Add ins are available and print their name and location in active sheet. Here is the code(I found it in internet) which needs to entered in a standard module--

Code:
Public Sub Addins_List_All()Dim oAddin As AddIn
Dim oCOMAddin As ComAddin
Dim icount As Integer
Dim istart As Integer
   For icount = 1 To Application.AddIns.Count
      Range("A" & icount).Value = Application.AddIns(icount).Name
      Range("B" & icount).Value = Application.AddIns(icount).FullName
      Range("C" & icount).Value = Application.AddIns(icount).Installed
   Next icount
   istart = icount
   For icount = 1 To Application.COMAddIns.Count
      Set oCOMAddin = Application.COMAddIns(icount)
      Range("A" & istart + icount).Value = Application.COMAddIns(icount).Description
      Range("B" & istart + icount).Value = Application.COMAddIns(icount).progID
      Range("C" & istart + icount).Value = Application.COMAddIns(icount).Connect
   Next icount
End Sub

Please help me. I want to protect my PROJECT.xlsm from any bad/unkown addins while using it.

Thanks and Regards,

PritishS
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Forum statistics

Threads
1,214,649
Messages
6,120,732
Members
448,987
Latest member
marion_davis

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