the code as of now is
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim I As Integer
Dim isInstalled As Boolean
Dim dummyVariant As Variant
On Error Resume Next
Application.ScreenUpdating = False
isInstalled = False
'Check whether AddIn is installed...
For I = 1 To AddIns.Count
If Trim(AddIns(I).Name) = "DBUpdater.xla" Then
isInstalled = True
Exit For
End If
Next I
' If not, then install it...
If Not isInstalled Then
' Install from CURRENT directory
AddIns.Add "F:\Finance\Excel\DBUpdater.xla"
Else
' Even if it's installed, it might not be active
If Not AddIns(I).Installed Then AddIns(I).Installed = True
End If
' Now run the damn thing already...
Call pertracupdatefund(ActiveWorkbook.Name)
'dummyVariant = _
Application.Run("DBUpdater.xla!UpdateData", _
ActiveWorkbook.Name)
' Lose the add-ins...
AddIns(I).Installed = False
Application.ScreenUpdating = True
End Sub