Problem:
Today just few minutes ago, I was going to open an *.xlsm (Microsoft Excel Macro) file. But after open it shows an error message. It says, "Can't find project or library". While I press "Escape" the excel file closed. While I clicked on "Ok", the Macro not working.
Why this problem?
According to Microsoft, it appears because, any of your used Excel VBA Reference is missing. they have described on their official site as below:
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:
Source: https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/can-t-find-project-or-library
Solution:
To solve this problem, first you need to identify your missing Excel VBA References and then uncheck the references.
Microsoft also shared a solution on the same site as below:
1. Display the References dialog box.
2. Select the missing reference.
3. Start the Object Browser.
4. Use the Browse dialog box to find the missing reference.
5. Click OK.
Repeat the preceding steps until all missing references are resolved.
Source: https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/can-t-find-project-or-library
The "Reference" dialog box is not opening in Excel VBA Environment:
Unfortunately I was unsuccessful to open the "Reference" dialog box in Excel VBA Environment. If you follow the above steps and want to solve your problem, I'm quite sure you may also be very annoyed. Because, when you will click "Tools | Reference" in "Microsoft Visual Basic Application" then you will see, nothing is opening.
Solution:
To open the "Reference" dialog box from Excel VBA Environment, what I did,
- I've closed all my opened Excel Files.
- Then rename the *.xlsm file with another name by adding or deleting 1 letter.
- After that I open the problematic .xlsm file and go to the Excel VBA Environment by pressing ALT+F11.
- Now when I click on "Tools | References.." it shows a dialog box. (My 1 Problem Fixed).
- Then, note down my "Marked" references.
- Uncheck all the "Marked" references except default 2/3 items.
- Then "Mark" back again on "noted references".
- Click Save in Excel VBA Environment.
- Close the Excel file.
Now my .xlsm file is working nicely.
Comments
Thank you so much for your help
I had the same issue with the reference menu not oppening and you were the only one to provide a solution !
All the best
Farah