Name already in use
VBA-Docs / Language / Reference / User-Interface-Help / can-t-find-project-or-library.md
- Go to file T
- Go to line L
- Copy path
- Copy permalink
- Open with Desktop
- View raw
- Copy raw contents Copy raw contents
Copy raw contents
Copy raw contents
Can’t find project or library
You can’t run your code until all missing references are resolved.
This error has the following causes and solutions:
A referenced project could not be found, or a referenced object library corresponding to the language of the project could not be found.
Unresolved references are prefixed with MISSING in the References dialog box. Select the missing reference to display the path and language of the missing project or library. Follow these steps to resolve the reference or references:
To resolve the references
Display the References dialog box.
Select the missing reference.
Use the Browse dialog box to find the missing reference.
Click OK.
Repeat the preceding steps until all missing references are resolved.
Once you find a missing item, the MISSING prefix is removed to indicate that the link is reestablished. If the file name of a referenced project has changed, a new reference is added, and the old reference must be removed. To remove a reference that is no longer required, simply clear the check box next to the unnecessary reference. Note that the references to the Visual Basic object library and host-application object library can’t be removed.
Applications may support different language versions of their object libraries. To find out which language version is required, click the reference and check the language indicated at the bottom of the dialog box. Object libraries may be standalone files with the extension .OLB or they can be integrated into a dynamic-link library (DLL) They can exist in different versions for each platform. Therefore, when projects are moved across platforms, for example, from Macintosh to Microsoft Windows, the correct language version of the referenced library for that platform must be available in the location specified in your host application documentation.
Object library file names are generally constructed as follows:
Windows (version 3.1 and earlier): Application Code + Language Code + [Version].OLB. For example: The object library for French Visual Basic for Applications, Version 2 was vafr2.olb. The French Microsoft Excel 5.0 object library was xlfr50.olb.
Macintosh: Application Name Language Code [Version] OLB. For example: The object library for French Visual Basic for Applications, Version 2 was VA FR 2 OLB. The French Microsoft Excel 5.0 object library was MS Excel FR 50 OLB.
If you can’t find a missing project or library on your system, contact the referencing project’s author. If the missing library is a Microsoft application object library, you can obtain it as follows:
If you have access to Microsoft electronic technical support services, refer to the technical support section of this Help file. Under electronic services, you’ll find instructions on how to use the appropriate service option.
If you don’t have access to Microsoft electronic technical support services, Microsoft object libraries are available upon request as an application note from Microsoft. Information on how to contact your local Microsoft product support organization is also available in the technical support section of this Help file.
For additional information, select the item in question and press F1 (in Windows) or HELP (on the Macintosh).
Can’t Find Project or Library – VBA Compile Error
The VBA Compile Error – Can’t Find Project or Library occurs when your VBA code refers to an external project or library that cannot be found on the user’s PC. To fix this, make sure that the reference exists in the correct location.
Add Reference to VBA Project
If you have referred to an external project or library in your VBA code, you need to reference the project or library.
Let us have a look at the following code example:
This code is referring to the Word object.
In order for this code to run correctly, a reference to the Word object library needs to be added to the VBA project.
In the Menu, select Tools > References.

Scroll down through the list of references to find the one you want to use. In this case, the Microsoft Word 16.0 Object Library.

(1) Select the reference and then (2) click OK and then Save your File.
Finding a Missing Reference
If your VBA project does contain a reference such as shown above, but the reference file is missing, when you try to compile the VBA code, you will get the compile error – Can’t find project or library.

In the Menu, select Tools > References.

If a reference is selected, but the file for that reference is missing, then it will show the word “MISSING” in front of the available reference. The file for the reference has been registered on the machine but the actual file has either been removed from the machine, is corrupt so cannot be used or has been moved from the location registered.
To solve this problem, remove the reference from the VBA Project by deselecting the reference and then clicking on OK.
If you then open the reference box again, the missing reference will be removed and you should be able to compile your VBA code.

Of course, if you are using that reference in your code (ie Word. Application), then when you re-compile the VBA Project, you may end up with another error!

You will need to find the missing file reference, make sure that it is registered on your computer, and make sure it’s in the correct location as indicated in the Location path at the bottom of the dialog box.
VBA Coding Made Easy
Stop searching for VBA code online. Learn more about AutoMacro — A VBA Code Builder that allows beginners to code procedures from scratch with minimal coding knowledge and with many time-saving features for all users!

VBA Code Examples Add-in
Easily access all of the code examples found on our site.
Simply navigate to the menu, click, and the code will be inserted directly into your module. .xlam add-in.
How to Fix «Can’t Find Project or Library» Error

Are you facing excel files that stop working, loading media files that could not be played, or opening a password but protected Errors? If the answer is yes, you’ve got the right place. Simply download Repairit to have a quick fix!
When using MS Excel document or MS Access that assimilate functions or buttons which need VBA (Visual Basic Applications) for the Macros to perform some assigned task, the user may get a compilation error «Can’t find project or library.»
Table of Contents
Part 1. What Is the Cause of the Error «Can’t Find Project or Library»?
1. This error is usually caused by the user’s MS Access or MS Excel program. The reason is that the program has a reference to an object or type of library which is missing and hence not found by the program. Accordingly, the program cannot use VB or Micro based functions or buttons. Therefore an error message is sent.
2. Sometimes a library may be toggled or toggled off, causing a missing link between the library and program code. So the compilation error is issued.
3. Since there are standard libraries, so missing a library sounds a bit of the least chance. The other possible reason, in that case, is that library miss-match is the cause of the error. For example, the user may have a library (sat Outlook) version of 2007, but the code’s reference may be looking for the 2010 version of that specific library. So the program fails to find the corresponding library, thus issuing this compilation error.
4. Another scenario for the same error message concerns the use of Microsoft XP, which includes a reference to web service in the VBA project. When you run this project in MS Office 2003, the same compilation error appears. The reason is the same, i.e., an object or type of library is missing (or not found).
Part 2. 4 Solutions to Fix «Can’t Find Project or Library» Error
Solution 1. Adding or Removing a Reference to a Library
The first solution to fix the “ Excel can’t find project or library ” error in MS Access is to remove a library reference. To do so, you can follow this step-by-step process.
Step 1: Launch MS Access on your PC and open the Database/Application that’s showing the error.
Step 2: Now, simultaneously press “Alt” + “F11” to launch the VBA editor window.
Step 3: Now, click the “Tools” button at the top menu bar and select “Preferences” from the drop-down menu.

Step 4: In the next dialog box, uncheck the “Missing: Microsoft Access Object” and click “Ok” to save your changes.

Restart MS Access and check if you encounter the same error anymore or not.
Solution 2. Registering a Library File
There are many situations when installing new software automatically de-registers a few specific libraries. In such cases, many MS Access functions will not work and you’ll be prompted with the “ Excel Can’t Find Project or library” error. A quick and easy way to fix this issue is to simply register a library file manually.
Although it’s a bit complicated to manually register a library file, you can follow these steps to get the job done.
Step 1: Right-click the “Start” button and click “Command Prompt (Admin)” to launch the command prompt as an administrator.
Step 2: Once you’re in the CMD window, simply type REGSVR32 “Path of the DLL File that you want to register”. For instance, REGSVR32 “C:\Program Files\Blackbaud\The Raisers Edge 7\DLL\RE7Outlook.dll”.
This will register the desired library file and you won’t encounter the same error anymore.
Solution 3. Try Un-Register Or Re-Register The Library
Finally, if nothing works, you can either re-register or unregister the library file completely to fix the error. First, let’s check out how to re-register a library file.
Step 1: Press “Windows” + “R” and type Regsvr32.exe.
Step 2: Press Enter and type the full path of the missing library file. For instance, “regsvr32 “c:\program files\common files\microsoft shared\dao\dao360.dll”.
If this doesn’t fix the error, you can simply unregister the library file, To do this, replace “Regsvr32.exe” with “regsvr32 -u” and again paste the path of the library.
That’s it; un-registering the library file will fix the “can’t find project or library” error and you’ll be able to work on your MS Access database without any interruption.
Solution 4. Repair MS Excel File with Excel Repair Tool
Third-party Excel file repair software is there to resolve all such matters quickly and accurately. One of the Best Excel file Repair software to repair damaged/ corrupt Excel files is described below.
This Wondershare Repairit — File Repair is available for single as well as multiple systems. The file repairing tool supports 11/10/8/7/Vista/XP versions of windows and supports 10.10
OS 10.13 for Mac. This permits the repair of corrupted Excel files ( . XLSX) and restores all the data from corrupt to the original Excel file.
"Can't find Project or Library" for standard VBA functions
So I’m having to run someone else’s excel app on my PC, and I’m getting «Can’t find Project or Library» on standard functions such as date, format, hex, mid, etc.
Some research indicates that if I prefix these functions with «VBA.» as in «VBA.Date» then it’ll work fine.
Webpages suggest it has to do with my project references on my system, whereas they must be ok on the developer’s system. I’m going to be dealing with this for some time from others, and will be distributing these applications to many others, so I need to understand what’s wrong with my excel setup that I need to fix, or what needs to be changed in the xls file so that it’ll run on a variety of systems. I’d like to avoid making everyone use «VBA.» as an explicit reference, but if there’s no ideal solution I suppose that’s what we’ll have to do.