Compile Error: Can’t find project or library
When using the VBA Code or Macros in Microsoft Access or Excel, the following error is received “Compile Error: Can’t find project or library”
Most likely, the application has lost the reference to an ActiveX or COM object or type library resulting in the above error when using VBA functions in Access or Excel such as the Barcode Font Encoder VBA. The problem may be resolved as follows:
- Open the database or application.
- Open a module in Design view or press ALT+F11 to switch to the Visual Basic Editor.
- On the Tools menu, click References.
- Clear the check box for the type library or object library marked as “Missing:”
- If you are using COM, ActiveX, or a DLL to format data to a barcode font, use the pure VBA code that is provided in the licensed version of the product.
An alternative to removing the reference is to restore the referenced file to the path specified in the References dialog box. If the referenced file is in a new location, clear the “Missing:” reference and create a new reference to the file in its new location.
Microsoft has documented this issue: VBA Functions Break in Access Database with Missing References