Wondershare Repairit
Excel Repair

Perfectly repair Excel files with different issues in minutes.

  • Fix all Excel file issues like blank Excel, Excel not opening, unreadable Excel, Excel running slow, etc.
  • Repair corrupted Excel files with a very high success rate in 3 simple steps.
  • Support Microsoft Excel 2019, 2016, 2013, 2010, 2007 and Office 365.
  • Perfectly compatible with different Windows & Mac system.
Secure Download

How to Fix "Can't Find Project or Library" Error with 5 Solutions? [2026]

Repairit Editorial Team
Repairit Editorial Team Originally published Oct 24, 26, updated Nov 03, 26

The Excel VBA compile error "Can't find project or library" usually means that the workbook's VBA project cannot resolve one of its referenced libraries. It does not automatically mean the Excel file is corrupted. A real r/excel discussion about the same VBA error also shows why checking references first is more useful than jumping straight to file repair.

Start by identifying any reference marked MISSING in the VBA editor. If the reference problem is resolved but this one workbook still will not open, save, compile, or behave normally, then move to Office repair or workbook repair.

In This Article
    1. Fix 1. Find the Reference Marked MISSING
    2. Fix 2. Restore, Replace, or Remove the Missing Reference
    3. Fix 3. Recompile the VBA Project
    4. Fix 4. Check Office Version and 32-bit/64-bit Compatibility
    5. Fix 5. Repair Microsoft 365 or Office
    1. Repair a Corrupted Excel File with Repairit

Part 1. What "Can't Find Project or Library" Means in Excel

The error appears when VBA cannot resolve one of the projects or object libraries referenced by the workbook. Microsoft explains that unresolved references are shown with a MISSING prefix in the References dialog, and VBA code cannot run normally until those references are resolved.

What you see What it usually points to What to check first
"Can't find project or library" when a macro runs or the workbook opens. A missing or incompatible VBA reference. Open the VBA References dialog and look for an entry marked MISSING.
The workbook works on one PC but fails on another. Different Office versions, bitness, installed applications, add-ins, or libraries. Compare the checked references and Office environment on both devices.
A third-party library is marked MISSING. The required application or component is absent, moved, or incompatible. Restore the supported dependency or update the reference.
The VBA references look correct, but one workbook still will not open or save properly. A separate Office installation or workbook-integrity problem may also exist. Test Office repair and then assess the workbook itself.

Microsoft's VBA documentation for the "Can't find project or library" error recommends resolving the missing reference. That is a better first step than registering arbitrary DLL files or changing unrelated Windows settings.

Part 2. Fix Missing or Broken VBA References

Work through the dependency problem before treating the workbook as damaged. The goal is to identify which reference VBA cannot resolve and then correct only that dependency.

Fix 1. Find the Reference Marked MISSING

Use this first: when the workbook opens but a macro, function, button, form, or event triggers the compile error.

  1. Open the affected workbook in Excel.
  2. Press Alt + F11 to open the Visual Basic Editor.
  3. Choose Tools > References.
  4. Look for a checked entry beginning with MISSING:.
  5. Write down the library name and any visible file path before changing the selection.
excel vba editor tools references menu

If no reference is marked MISSING, do not remove random libraries. Move to the compatibility and Office repair checks below.

Fix 2. Restore, Replace, or Remove the Missing Reference

What you do next depends on whether the workbook actually uses that library.

  • If the code needs the library: reinstall or restore the supported application, add-in, or library version, then select the correct reference in Tools > References.
  • If the project no longer uses it: clear the missing reference, save a copy of the workbook, and compile the VBA project to confirm that no code still depends on it.
  • If the library changed after an upgrade: select a compatible replacement and review the affected VBA declarations or objects before saving.
excel vba references dialog showing missing library

Do not uncheck references at random. A checked library may still be required by code even if the workbook interface does not make that dependency obvious.

Fix 3. Recompile the VBA Project

After resolving the missing reference, compile the project so Excel can surface any remaining VBA errors.

  1. Keep the workbook open in the Visual Basic Editor.
  2. Select Debug > Compile VBAProject.
  3. If VBA highlights another line, object, or declaration, fix that issue before saving.
  4. Save a copy of the workbook, close Excel, reopen it, and test the macro or action that originally triggered the error.
excel vba debug compile vbaproject option

If compilation finishes without another error, the broken reference has likely been addressed. If the same workbook works on one PC but not another, continue with the environment comparison below.

Fix 4. Check Office Version and 32-bit/64-bit Compatibility

This check is especially useful after an Office upgrade, a PC migration, or a move between 32-bit and 64-bit Office.

  1. In Excel, open File > Account > About Excel and note the Office version and whether it is 32-bit or 64-bit.
  2. Compare the same information on a computer where the workbook works correctly.
  3. Open Tools > References in the VBA editor on both systems and compare the selected libraries.
  4. If the workbook depends on a third-party COM library or another Office application, install a compatible version or update the VBA reference and code for the current environment.
excel about window showing office version and 64 bit information

Switching Office bitness alone is not a guaranteed fix. The important question is whether every referenced library and any related VBA declarations are compatible with the installed environment.

Fix 5. Repair Microsoft 365 or Office

Use Office repair when the VBA editor, references, or Excel installation behaves incorrectly across more than one workbook.

  1. Close Excel and other Office applications.
  2. Open Windows Settings > Apps > Installed apps.
  3. Find Microsoft 365 or your Office installation and choose its modification option.
  4. Start with Quick Repair. If the problem remains, use Online Repair when appropriate for your environment.
  5. Restart Excel and retest the workbook.
microsoft office quick repair and online repair options

Microsoft provides the current repair flow for Office installations in its Office application repair instructions.

Part 3. Repair the Excel Workbook Only If the File Is Damaged

Repairit should not be the first fix for a simple missing VBA reference. Use file repair only when the workbook itself shows signs of corruption, such as failing to open, becoming unreadable, refusing to save correctly, or remaining broken after the reference and Office environment have been checked.

Wondershare Repairit for Corrupted Excel Workbooks

If the workbook file itself is damaged, Repairit Excel File Repair provides a dedicated workflow for supported Excel corruption scenarios. You can also visit the Wondershare Repairit homepage to explore the broader family of file, video, photo, and audio repair tools.

  • Use it after missing-reference and Office-installation checks fail to explain the workbook problem.
  • Keep the original workbook unchanged while testing a repaired copy.
  • Preview the repaired result before deciding whether it is usable.

Repair a Corrupted Excel File with Repairit

When the workbook itself is corrupted, use the File Repair workflow below. The original Repairit procedure screenshots remain applicable to these steps, so they are retained.

Try It Free
Try It Free

Step 1. Add the damaged workbook. Open Repairit, choose More Types Repair > File Repair, and add the affected Excel file.

add a corrupted excel workbook to repairit file repair

Step 2. Start the repair. Select the workbook and choose Repair. Keep the original file in its current location while Repairit processes the added copy.

start repairing a corrupted excel workbook in repairit

Step 3. Preview the repaired workbook. Check the available sheets and content in the preview before saving.

preview the repaired excel workbook in repairit

Step 4. Save the repaired result. Save the repaired workbook to a different folder and test its formulas, links, macros, and important sheets before replacing any working copy.

choose a new location to save the repaired excel workbook
Try It Free
Try It Free

Part 4. Prevent the "Can't Find Project or Library" Error from Returning

Macro-enabled workbooks are easier to maintain when their dependencies are documented instead of being tied silently to one PC.

  • Record required references: document the applications, libraries, add-ins, and versions the VBA project depends on.
  • Test before an Office migration: open a copy on the new Office version or device before replacing a known-working environment.
  • Avoid unnecessary references: remove unused dependencies only after confirming that the project compiles without them.
  • Keep a known-good backup: save a verified copy before major VBA, Office, or add-in changes.
  • Separate VBA errors from general Excel failures: if Excel itself starts crashing or refusing to open files, follow the appropriate Excel stopped working troubleshooting path instead of treating every failure as a missing-library problem.

Conclusion

Excel's "Can't find project or library" error is primarily a VBA dependency problem. Identify the reference marked MISSING and restore, replace, or remove it based on what the code actually needs. If the problem follows one workbook even after the VBA references and Office installation are healthy, then investigate workbook corruption and use file repair only for that separate failure state.

Try It Free
Try It Free

FAQ

  • Why does Excel say "Can't find project or library"?
    VBA cannot resolve a referenced project or object library. Open the Visual Basic Editor, go to Tools > References, and look for an entry marked MISSING before trying broader repair steps.
  • How do I fix a missing reference in Excel VBA?
    Restore or select the compatible library if the code requires it. If the project no longer uses the missing dependency, clear that reference and compile the VBA project to confirm nothing still depends on it.
  • Should I use REGSVR32 for this Excel error?
    Not as a generic first step. Registering or unregistering an arbitrary DLL can be irrelevant or risky. Identify the actual missing reference first and use the supported installation or repair path for that dependency.
  • Can an Office upgrade trigger "Can't find project or library"?
    Yes. A workbook can depend on a library, add-in, Office application, or VBA declaration that differs between Office versions or between 32-bit and 64-bit environments. Compare the References list and dependencies on the working and failing PCs.
  • Can Repairit fix the "Can't find project or library" error?
    Repairit is relevant only when the Excel workbook file itself is corrupted. It does not install a missing VBA library or fix an incompatible reference. Resolve the VBA dependency first, then use file repair only if the workbook remains damaged.
Share article:
Get Repairit Get Repairit
logo
Relumi - AI Photo Enhancer

Revive memories in 3 steps

open
logo
Relumi - AI Photo Enhancer

Revive memories in 3 steps

open