Error Message from References to Add-ins
I am having a problem hiding errors that pop up when a reference to an external add-in is not found in VBA. We have written code and created an add-in for tracking changes to an Excel workbook. This add-in will insert code to a selected workbook. The problem exists when a person who does not have the add-in opens then closes the workbook (which is fine). The BeforeClose event will call a routine that uses code from the add-in. If the person does not have the add-in, we want VBA to simply ignore the code. But the user will get the error "Compile error: Can't find project or library." An error handler doesn't seem to help. Any ideas for getting around this?
The code is below. The error occurs on the "Call DMSFeSOX.ChangeTracking.logChanges" line. This the reference to the add-in.
Public Sub CloseProcess(intStatus As Integer)
On Error GoTo CloseProcess_Err
If ActiveWorkbook.Sheets("ChangeLog").Visible = True Then
If intStatus = 2 Then
ThisWorkbook.Saved = True
Call Error_Handler2(strMod:="eSOX200-200-100", intErrNum:=Err.Number, intErrDesc:=Err.Description)