View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Remove Excel addin completely

It depends where the addin is. If it's in one of the default addin folders
simply remove it (after uninstalling it if not already).
Application.UserLibraryPath and for backwards compatibility
..Application.LibraryPath

If it's not in a default folder it will no longer appear in the addin's
list, however it will still remain in the addins collection and in the
registry (as GS mentioned). First uninstall the addin, either manually or
programmatically. Close *all* instances of Excel. Delete the relevant entry
in this key -

HKEY_CURRENT_USER\Software\Microsoft\Office\X.0\Ex cel\Add-in Manager

where X is the Excel version, eg 11 for 2003

Regards,
Peter T


"CB" wrote in message
u...
Hello,

The sample code I found below uninstalls an Excel add-in but leaves it in
the list of available Add-ins.

Im looking for a script to "completely" remove the Excel addin (tidy is
nice!).

I need to do this across a range of users with Office 2003 & 2007 so I was
wanting to reference Excel objects rather than Registry Keys which vary
depending on the Office Version.

Does anyone know if there is code to "completely" remove an Add-in?
Kind Regards
Charlie.B

Dim oXL
Dim crAddin
on error resume next
Set oXL = CreateObject("Excel.Application")
for i = 1 to oXL.Addins.Count
Set crAddin = oXL.Addins.item(i)
If crAddin.Name = "xpaddin.xla" then
crAddin.Installed = False
End If
Next
oXL.Quit
Set oXL = Nothing