I can't seem to replicate this error but it happens at least once a week. I open a file where I created some script. Does not matter if it is an older file or a newer one and I get the dreaded error "Can't find Project or Library". This means that the Reference Library is missing a Module/Tool that it can no longer reference. I scratch my head and wonder for a moment, "I did not make any changes to my tool references so how can this be. To further agitate me When I open VBA Editor and select Tool Reference the sheet does nothing. Won't show me tools and now the code has disappeared. I can see the modules in the project window but the sheet is blank.
So first I have to fix it. Usually, I can fix it by first closing out of all Excel Apps. Then, while holding down Ctrl and clicking on a new Excel app to open, I open Excel in Safe mode. I open the file. Then I go into VBA Editor and select Tools Reference and I can see that one of my files instead of being stored in with the system files it is normally saved to, it has been saved to my C Drive Documents. When I go look there the file is not there. However, if I search for the file in my system files (C:Program Files\Common Files\Microsoft Shared\VBA) I find it and re-sync it.
But what is crazy to me is how did that file location change in the first place? Has anyone else experienced this issue more than a few times?
I am 100% certain it is nothing in my code causing this to occur.
I think the problem relates to when Excel has a large file or several files open causing it to run at a high PC Utilization rate, Excel begins to act very crazy. When this occurs and I start shutting things down, the next time I re-open the file is when I will notice the file reference error.