VBA error - Can't find project or library

%3CLINGO-SUB%20id%3D%22lingo-sub-1785801%22%20slang%3D%22pt-BR%22%3EVBA%20error%20-%20Can't%20find%20project%20or%20library%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1785801%22%20slang%3D%22pt-BR%22%3E%3CP%3EHi%20everyone%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20an%20issue%20with%20Excel%20VBA%2C%20I%20have%20many%20dashboards%20in%20Excel%20all%20have%20the%20same%20VBA%20and%20in%20some%20show%20the%20message%20'Can't%20find%20project%20or%20library'%20if%2C%20I%20have%20Microsoft%20365%20if%20I%20open%20in%20version%20another%20example%20%22Enterprise%22%20the%20excel%20open%20normally%20and%20the%20people%20change%20and%20save%2C%20after%20this%20I%20can%20open%20in%20my%20Office%2C%20and%20save%20normally%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ECan%20someone%20help%20me%3F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EThanks%2C%20advanced%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1785801%22%20slang%3D%22pt-BR%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1786780%22%20slang%3D%22en-US%22%3ERe%3A%20VBA%20error%20-%20Can't%20find%20project%20or%20library%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1786780%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F834218%22%20target%3D%22_blank%22%3E%40Joly_BR%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOpen%20Tools%20--%26gt%3B%20References.%20Do%20you%20find%20any%20missing%20reference%20in%20there%2C%20if%20so%20try%20unchecking%20the%20checkbox%20next%20to%20the%20missing%20reference.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

Hi everyone 

 

I have an issue with Excel VBA, I have many dashboards in Excel all have the same VBA and in some show the message 'Can't find project or library' if, I have Microsoft 365 if I open in another version example "Enterprise" the excel open normally and the people change and save, after this I can open in my Office, and save normally

 

Can someone help me?

Thanks, advanced 

3 Replies

@Joly_BR 

Open Tools --> References. Do you find any missing reference in there, if so try unchecking the checkbox next to the missing reference.

@Joly_BR 

Hi,

I've been dealing with corrupt Excel files for months and months, often resorting to fully rebuilding quite complex models. The files are corrupt when the VBA modules loose the library. I don't know why it happens, but this message appears "Can't find project or library". The file works, but all VBA is lost.

I have now found a solution that is surprisingly easy and hope by sharing it many people will be saved hours of frustration.

 

Process:
I save my files in a OneDrive and access them in the Excel App, via windows explorer - the corrupt files does not work. If I go to the SharePoint and open the file in the web browser (VBA and other active controls wont work in this environment) and then select to open the file in the Excel App from the web browser, all VBA libraries are restored and macros work again. From there "Save As" back to the original location and you're good to go!

 

I hope this works for you.

@richard10, this worked for me! you're awesome!