ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Uninstall Addin (https://www.excelbanter.com/excel-programming/327193-uninstall-addin.html)

Jos Vens[_2_]

Uninstall Addin
 
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



keepITcool

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


Jos Vens[_2_]

Uninstall Addin
 
That's a pitty, because on slow networks, it costs a lot of time for the
loop (sometimes more than 3 minutes!).

"keepITcool" schreef in bericht
.com...

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





All times are GMT +1. The time now is 11:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com