VBA error - Can't find project or library

Copper Contributor

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!