Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MS Access Can't Find Project or Library Error

I am working on an access database that was built for me to use. I am familiar with writing VBA code to perform functions, however, I am not at all versed in debugging certain errors.

There is a form in the database that allows me to clean up and manipulate data in files that I can select from my computer. It uses a folder as the main root to look into where I supply the form with the names of the files located in the folder. There is also a button that is connected to perform the data clean up and manipulations.

Now that the background is out of the way, there is an error that I can't seem to get passed. It also looks like if I solve the error, it snowballs into something else. Essentially the error is a "Cannot find Project or Library." After going into my resources I noticed that there is a Microsoft Excel 15.0 Object Library that is missing. Does anyone know the relationship between this error and access, as well, as how to fix this?

like image 566
Michael Westbrooks II Avatar asked Jul 09 '15 19:07

Michael Westbrooks II


People also ask

How do I fix compile errors in VBA?

I have resolved same error by following these 4 steps : Open Excel file which is having issue, press Alt + F11 go into its Visual Basic Editor. From the Tools menu select References ( Note, if references option is disabled in tools menu try closing and reopening file and enable Macro before proceeding next steps)


1 Answers

This is a common problem in Microsoft Office VBA. While it can have more than one cause, in your case it appears that the person who developed the solution for you was using a different version of Office from yours for development of the code. (I get the same error whenever I move the same application between Office 2003 and Office 2010 platforms.)

To fix the problem:

  1. In the Tools..References window, uncheck the "MISSING: Microsoft Excel 15.0" reference.
  2. Scroll down the list of references, which are arranged alphabetically. Locate the entry for the object library for Microsoft Excel (which I presume you have on your machine), but whose version number will be different. Check that.
  3. Recompile and Save.

It would be nice if the VBA environment was able to provide a more useful error diagnostic, but I'm not sure how easy this would be for Microsoft to accomplish, given that interoperation between VBA and the library uses the venerable COM technology: error recovery would involve VBA recognizing that an alternative, and to attempt to use that library as a substitute.

like image 63
Prakash Nadkarni Avatar answered Oct 02 '22 18:10

Prakash Nadkarni