PDA

View Full Version : Excel Can't Find Library for "Chr" Function



Cyberdude
07-30-2006, 02:46 PM
Every once in awhile I have an Excel crash, and lately the recovery process gives me a compilation error on a macro in Personal.xls that is using the function "Chr". The error message says "Can't find library". Since I've been using this particular function for a long time, I'm puzzled about what library "Chr" is resident in. The recovery is at a standstill until I comment out the macro line that is using Chr, then by doing a little of this and a little of that I'm able to coax the recovery to completion. When I ask what the problem was, the response is "No error was found" or some such thing. Does anyone know what library "Chr" is in?

Another curious thing that's been happening lately in crash recovery is that the system shows as many as four other workbooks that I did not have open when the crash occurred. Now that's weird! Since I'm able to close them without saving, it's not really a problem.

Justinlabenne
07-31-2006, 05:30 AM
Can't Find Library is usually due to a missing dll reference.

VBE > TOOLS > REFERENCES > Look for "MISSING" next time it occurs.

Cyberdude
08-02-2006, 02:46 PM
Justin, thanks for the reply. Since I made this post I haven't had the problem occur again, which shows that it's some sort of transient problem that occurs just once in awhile when conditions are right. But I CAN count on it occurring again. I'm not sure I understand looking for "Missing" in the reference list, but I'll check it the next time the problem occurs. It would help if I knew where the function "Chr" is resident.

Ken Puls
08-02-2006, 07:18 PM
Actually, Sid, it isnt' necessarily relevant. When a missing reference presents itself, it manifests in the way you've seen, even though the library that Chr is in is perfectly fine, including an intact reference.

Guessing here, but I think it might be the way that Excel "looks" for functions. Maybe the Excel object model first, then each library in turn. It just may be that while Chr's library is intact, the "missing" reference comes before the Chr's library one.

I have nothing to base that last part on but feeling, so it may not be totally right. Regardless, the effects are mainifested as you described. :)