|
Subject:
|
Error Message from References to Add-ins
|
|
Posted By:
|
mark@datamosaics.com
|
Post Date:
|
8/7/2006 4:27:57 PM
|
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 Call hideChangeLog2 End If If intStatus = 2 Then Call DMSFeSOX.ChangeTracking.logChanges Call DMSFeSOX.ChangeTracking.deleteTempBook Call DMSFeSOX.ChangeTracking.eraseTempFilename End If ThisWorkbook.Save ThisWorkbook.Saved = True CloseProcess_Exit: Exit Sub CloseProcess_Err: Call Error_Handler2(strMod:="eSOX200-200-100", intErrNum:=Err.Number, intErrDesc:=Err.Description) Resume CloseProcess_Exit End Sub
|
|