PDA

View Full Version : ?Can?t Find Project or Library?



Cyberdude
12-19-2006, 04:32 PM
I am really in a panic. All of a sudden I get the following message when I open most of my workbooks:
?Compiler error
Can?t find project or library?

Here?s the list of items that are checked in my References list:

Visual Basic for Applications
Microsoft Excel 11.0 Object Library
Microsoft Office 11.0 Object Library
atpvbaen.xls
Microsoft Visual Basic for Applications Extensibility 5.3
OLE Automation

The item that triggers the error most of the time is function CHR that is being used in a macro in my Personal.xls workbook. I can?t remember the items in the References list that used to be there, but it seems to me that I always had VBAProject, which is the name for Personal.xls. I don?t see it anywhere now. I tried adding it manually, but got the message that it was a duplicate, but I can?t find a VBAProject anywhere in the list.

Can anyone offer a solution? :help

mdmackillop
12-19-2006, 04:44 PM
Hi Sid
Check for a reference marked as Missing and remove the tick.
Regards
MD

Cyberdude
12-19-2006, 05:42 PM
Hi, Malcolm!
Nothing that is checked is marked as missing. But I've discovered something else weird.

If I check funcres, then close References, then go back into References, I see that VBAProject (read Personal.xls) is present and funcres is now unchecked. What's more, everything works OK until I restart Excel. Then everything is back to the way it was before I checked funcres.

What library is the function CHR in? I can't remember which one, but another of the Excel functions also couldn't be found.

mdmackillop
12-19-2006, 05:56 PM
I've always found this related to a missing reference. If it's not that, I don't know.

tstom
12-19-2006, 08:53 PM
CHR belongs to VBA.Strings. Select CHR in the code editor and hit F2. If you are not missing a reference then there may be a conflict in your registry. Download and run CCLeaner on your registry. As for the Strings module, I would fully qualify any method located in this module because it is the one that causes the most trouble because so many other languages use similiar method names such as Left, Right, ect... I do not understand why these methods are in a public standard module as opposed to a public class. I guess MS has their reasons.

Change CHR to VBA.Strings.CHR
Fully qualify everything until you no longer recieve compile errors.

This will probably take care of the symptom though the problem may still remain. :)