MSEXCEL 2016 VBE : Can't find project or Library error

ambly

New Member
Joined
Jan 2, 2012
Messages
12
At my Workplace which is a Home Office, running PC:
Windows 10 Pro
MS Office 2016, released via Office 365

Problem with: A specific MS Excel File (xlsm), that has been working perfectly fine since 2013. MS Office 365, has been on the machine for past 2 years.

The Wb (lets say MyWB) is behaving as a database. Within the Project it has Forms, Modules, code that controls how it opens, closes, activates, presents and so on. It has 33300 records and counting. The file size is about 6.5MB. Aside from the recurring issue below, it operates smoothly.

Issue:
Since the start of this year, MyWB has 'crashed' 4 times - in as much as it wont load the Project (msg: "Can't find project or library".

If I persist, the dialog : 'Visual Studio Just-in-time Debugger' pops up, stating "an unhandled win32 exception occurred in EXCEL.EXE (2960)" with The Possible Debuggers: New Instance of Mirosoft Office Studio 2010"

I have many other xlsm workbooks, which open fine. It's just this one.

Twice I have 'rebuilt' the broken File - by exporting each 'form''module' 'this workbook' out of a back up copy of MyWB- then creating a new workbook, moving the up-to-date worksheets from MyWB, then importing the project items ( 'form''module' 'this workbook') back in.

Then off it goes, fine until the next time it happens.

The last time it happened, I began to wonder if it was some update that is causing the problems. Or if the something that out ESET security app was doing. So rather than 'rebuild' I decided I would take the misbehaving MyWB home to my own PC (I emailed it to myself). At home, where I also run Office 365, it opened perfectly fine. So I saved it on myPC, then emailed it back to work. When I opened it at work, saved it back onto my Work PC, it opened fine, no problems - this was maybe 2 weeks ago - and it's been okay until today.

I see by google searching the "Can't find Project or Library" error, that a lot of the solutions seem to involve opening up the file, going into VBE, > Tools> References Dialog where I look for and uncheck specific "MISSING" items.

However, when I try do this, I cannot even get the Reference Dialog to open up at all. It's not greyed out, but it will not fire up. Same if I open the file in SAFE mode.

Help! Sorry for long msg, but I'm trying to provide as much info as I think you might need to help me.

Thank you for all help offered.

Cheers
Annie
 
Last edited:

GirishDhruva

Active Member
Joined
Mar 26, 2019
Messages
308
Hi Mike, I did find myself a solution - though the issue itself is on going! I am only on my phone at mo - i need to get to my files.


Excellent, it worked for me.

Regards,
Dhruva.
 
Last edited by a moderator:

Some videos you may like

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

ffffloyd

New Member
Joined
Feb 10, 2018
Messages
5
I just want to add that this also worked for me after a very frustrating two days during which four spreadsheets I had been working on all suffered from the same problem.

Two of them, I laboriously reconstructed but two of them remained broken until I found this fix.

After the fix worked, we worked out that the problem had been caused by an unstable internet connection. What I thought was being saved to my local Documents folder was, in fact, being redirected to an office server. For some reason, during the save process, part of the file was not being saved. I infer that it was part of the compiled VBA code. Applying the method described here fixes that compiled portion, which I am then able to save back. The size of the fixed file is subtly different from the size of the corrupted file.

Thank you to Ambly for posting such a comprehensive, step-by-step solution.
 

johncox3

New Member
Joined
Sep 23, 2020
Messages
3
Office Version
  1. 365
Platform
  1. Windows
I am not familiar with the recompile line. If I type exactly as shown:
‘ Recompile 270310 error.

(with and without the period after error, it shows as a red "errored" line. It returns "Expected: end of statement" if I try to run the Compiler.
If I remove everything after the word recompile it says "Invalid outside procedure".
So I am not sure how to get it to recompile. Also, one more question, once I figure out the recompile process, Do I comment out the ‘ Recompile 270310 error line from the code.

One more question, would the recompile line go above or under any global declarations at the top of the module? Or does it matter? I tried both.

I sure do appreciate the help. I feel oh-so close to "solving", at least temporarily each time.
I had this problem, and just opening a version I sent myself without macros enabled allowed me to save it back in the original folder in a new name. Came out, went back in. Fixed.
 

johncox3

New Member
Joined
Sep 23, 2020
Messages
3
Office Version
  1. 365
Platform
  1. Windows
I had this problem, and just opening a version I sent myself without macros enabled allowed me to save it back in the original folder in a new name. Came out, went back in. Fixed.
Macros disabled rather
 

MikeDBMan

Well-known Member
Joined
Nov 10, 2010
Messages
589
The whole key to fixing it is not to type anything new in the VBA module but just to load the file without macros enabled. Then go to the macro editor and recompile. Then save and then when you reopen it, enable macros and all is well. Usually this happens to a file I have as a trusted file. So I rename it so that macros don't auto-enable. Then recompile, save, unload, rename and then reopen and all is well. Or if the file is in a trusted path, I move it to a path I've named "C:\untrusted\" where macros are not to be enabled. Then open, recompile, save and then copy back to original location and all is well.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,355
Messages
5,595,680
Members
414,008
Latest member
SNesbyCarr

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top