i am trying to uninstall an addin when i close my file. when i open certain files, i install it then. so i don't alway need the addin. this is the code i tried to use but it doesn't seem to do it. any help is greatly appreciated.
[VBA]
Dim bIsClosing As Boolean
' in case the user cancel the file close
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Cancel = False
bIsClosing = Not Cancel
End Sub
Private Sub Workbook_Deactivate()
On Error Resume Next
If bIsClosing = True Then
Application.AddIns("IclAddIn").Installed = False
End If
On Error GoTo 0
End Sub
[/VBA]