Thread: Uninstall Addin
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
keepITcool keepITcool is offline
external usenet poster
 
Posts: 2,253
Default Uninstall Addin


there's no faster way than looping thru the addins.
UNLESS your addin is unloading itself so you're sure it's loaded.

Sub AddinDeactivate1()
Dim wkb As Workbook, ai As AddIn, sIndex As String
On Error Resume Next
Set wkb = Workbooks("libra.xla")
If Not wkb Is Nothing Then
If wkb.Title < vbNullString Then
sIndex = wkb.Title
Else
sIndex = wkb.Name
If InStr(sIndex, ".") 0 Then
sIndex = Left$(sIndex, InStr(sIndex, ".") - 1)
End If
End If
Else
Beep
End If
Set ai = AddIns(sIndex)
If Not ai Is Nothing Then
If ai.Installed Then ai.Installed = False
End If

End Sub

Sub AddinDeactivate2()
Dim ai As AddIn
On Error Resume Next
For Each ai In AddIns
If ai.Name = "libra.xla" Then
If ai.Installed Then ai.Installed = False
Exit For
End If
Next
End Sub


hth


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Jos Vens wrote :

Hi,

I want to uninstall my addin, but this does not work

AddIns("Libra.xla").Installed = False

I know you can loop through all addins, but that is too
time-consuming, so, is it possible to uninstall one specific addin?

Thanks
Jos Vens