I was looking for some code to remove an AddIn from the AddIn Manager List
after it has been uninstalled and killed (or AddIn moved to another
location). I noticed that on searching this newsgroup that I'm not the only
one after this sort of automation.
I managed to come up with this code after looking at other attempts (see
http://tinyurl.com/nxxmt for my main inspiration) which should remove EVERY
AddIn that is no longer valid. I hope it is helpful.
- - - - - - - -
Sub ClearAddinRegister()
Dim MyCount As Long
Dim GoUpandDown As String
'Turn display alerts off so user is not prompted to remove Addin from list
Application.DisplayAlerts = False
Do
'Get Count of all AddIns
MyCount = Application.AddIns.count
'Create string for SendKeys that will move up & down AddIn Manager List
'Any invalid AddIn listed will be removed
GoUpandDown = "{Up " & MyCount & "}{DOWN " & MyCount & "}"
Application.SendKeys GoUpandDown & "~", False
Application.Dialogs(xlDialogAddinManager).Show
'Continue process until all invalid AddIns are removed since
'this code can only remove one at a time.
Loop While MyCount <> Application.AddIns.count
Application.DisplayAlerts = True
End Sub
- - - - - - - -
Cheers!
Richard Reye
"Never argue with an idiot. They'll bring you down to their level then beat
you with experience" - someone