Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 7th, 2006, 04:27 PM
Registered User
Join Date: Aug 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
        Call hideChangeLog2
    End If

    If intStatus = 2 Then
        Call DMSFeSOX.ChangeTracking.logChanges
        Call DMSFeSOX.ChangeTracking.deleteTempBook
        Call DMSFeSOX.ChangeTracking.eraseTempFilename
    End If
    ThisWorkbook.Saved = True
    Exit Sub
    Call Error_Handler2(strMod:="eSOX200-200-100", intErrNum:=Err.Number, intErrDesc:=Err.Description)
    Resume CloseProcess_Exit
End Sub

Similar Threads
Thread Thread Starter Forum Replies Last Post
Office Add-ins Virath BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 April 21st, 2008 03:37 AM
Add Push button or Check Box in outlook add-ins capdevs VS.NET 2002/2003 0 January 7th, 2006 08:51 AM
VBE Add-ins crmpicco Excel VBA 0 May 11th, 2005 06:59 AM
Add-Ins jacemiles BOOK: Beginning Access VBA 0 February 2nd, 2004 12:40 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.