excelstarter1
Board Regular
- Joined
- Jul 20, 2017
- Messages
- 81
Hey guys,
I tried the following code to deactivate all running addins except one addin which I want to keep. However, I always get runtime error "Subscript out of range (Error 9)" in the Installed = False line of my code. I was not able to deactive any addins so far... Do you have a better approach or an improvement of my code?
Thanks in advance!
Regards
I tried the following code to deactivate all running addins except one addin which I want to keep. However, I always get runtime error "Subscript out of range (Error 9)" in the Installed = False line of my code. I was not able to deactive any addins so far... Do you have a better approach or an improvement of my code?
Thanks in advance!
Regards
Code:
Sub DeactivateAddIns()
Dim i As Integer
Dim MyaddInName As String
For i = 1 To AddIns.count
MyaddInName = AddIns(i).Name
If MyaddInName = "AddinIWantToKeep" Then 'Skip the Addin I want to keep
Else
Application.AddIns(MyaddInName).Installed = False 'Deactivate all addins
End If
Next i
End Sub
Last edited: