none
Excel 2010 macro compile error: can't find project or library

    Question

  • Recently installed MSOffice 2010 Pro trial version and receive the following Macro error in Excel: compile error.  Can't find project or library.  The Excel file was created with Office 2003 and runs okay with the Professional version of 2003, but not the SMBS Excel 2003.  I tried setting the macro security level to low in 2010, however, the macro still will not run. 
    Wednesday, October 13, 2010 2:59 PM

Answers

  • Hi,

     

    Most likely, the application has lost the reference to an object or type library resulting in the above error when using Barcode Macros & Native VBA Functions. The problem may be resolved as follows:

    1.       Open the database or application.

    2.       Open a module in Design view or press ALT+F11 to switch to the Visual Basic Editor.

    3.       On the Tools menu, click References.

    4.       Clear the check box for the type library or object library marked as "Missing:"

    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 Database with Missing References

     

     

    Regards,

     

    Harry Yuan

    • Proposed as answer by Harry Yuan Thursday, October 14, 2010 8:41 AM
    • Marked as answer by sacjac Thursday, October 14, 2010 1:10 PM
    Thursday, October 14, 2010 8:41 AM

All replies

  • Hi,

     

    Most likely, the application has lost the reference to an object or type library resulting in the above error when using Barcode Macros & Native VBA Functions. The problem may be resolved as follows:

    1.       Open the database or application.

    2.       Open a module in Design view or press ALT+F11 to switch to the Visual Basic Editor.

    3.       On the Tools menu, click References.

    4.       Clear the check box for the type library or object library marked as "Missing:"

    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 Database with Missing References

     

     

    Regards,

     

    Harry Yuan

    • Proposed as answer by Harry Yuan Thursday, October 14, 2010 8:41 AM
    • Marked as answer by sacjac Thursday, October 14, 2010 1:10 PM
    Thursday, October 14, 2010 8:41 AM
  • Thanks this worked.
    Thursday, October 14, 2010 1:11 PM
  • I just thought I should highlight the fact that you can still receive this error even if a library you are not referring to in code is 'MISSING' but checked.

    Therefore make sure all the libraries with missing besides their title are repaired and 'uncheck' any libraries that you are not using.

    ~Rob~


    • Edited by RobsFury Tuesday, August 14, 2012 7:09 PM
    Tuesday, August 14, 2012 7:08 PM
  • Many thanks Harry for posting this simple fix..
    Saturday, February 01, 2014 3:38 AM
  • I just thought I should highlight the fact that you can still receive this error even if a library you are not referring to in code is 'MISSING' but checked.

    Therefore make sure all the libraries with missing besides their title are repaired and 'uncheck' any libraries that you are not using.

    ~Rob~


    Quick question... I have an excel file with VBA code attached to it. It works find for me an 95% of the other people using. One guy is getting the compile error object not found message. If he un-checks the box won't that un-check the box for everyone after he saves the file?  If it will, why would this be giving one guy out of 10 others a problem?

    Friday, March 28, 2014 3:06 PM