PritishS
Board Regular
- Joined
- Dec 29, 2015
- Messages
- 119
- Office Version
- 2007
- Platform
- Windows
Dear Sir/Madam,
Greetings!!
I have been looking for the solutions for last 2 days and spent almost 36 hrs on my laptop..
. 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:
Workbook_BeforeClose event:
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--
Please help me. I want to protect my PROJECT.xlsm from any bad/unkown addins while using it.
Thanks and Regards,
PritishS
Greetings!!
I have been looking for the solutions for last 2 days and spent almost 36 hrs on my laptop..

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