Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error "can't find project or library"

Status
Not open for further replies.

flpro

Programmer
Sep 18, 2005
16
US
Hi there,

I'm helping a friend out. Basically another programmer setup a spreadsheet to create some reports in excel. I have never done programming with excel or working with vba. This is my problem. When the user runs this spreadsheet they're getting this error:

Compile Error
Can't Find project or library

Then it brings up the "Microsoft Visual Basic" program, I guess it's vba. And there's a window ("Workbook","Open" method) with code and it highlights the first "Format" in this code:

sdatestr = Format(Year(Sheet1.SDate), "0000") & Format(Day(SDate), "00") & "0000"

Basically for me it seems that the program is looking for a function called "Format" but isn't this function built into excel vba? Any ideas which file/function is missing?

Thanks!



 
You have to check for missing references:
menu Tools -> References ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
thanks for the help. Unfortunately I don't have excel on my computer to see the options. So you're saying that there's an option "references" under tools? So how do I know if one is missing?
 
ok, I'm in the machine that's having the problem. The user reports that the problem started happening after they installed Crystal Reports on the machine, so they took it out and the problem still exists. So how do I make sure all the references are there?
 
Oh by the way, it's Excel 2000, and when I go to the "tools" menu there's no "references" option.

Any help greatly appreciate it. Thanks.
 
You have to go to VBE first:
either Alt+F11 or Ctrl+G

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I want to weigh in here. Unfortunately, I don't have an answer to the problem, per se. No external reference should be needed in this case since the Format function is built-in to VBA. However I have experienced the same error, intermittently, but don't know what "cured" it.

Regards,
Mike
 
Just a note -- I've received exactly the same error message in MS Word when another user opened a doc of mine and tried to run a macro it contained. I'm still trying to figure out how to get past that VBA message so she can run the macro.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top