Date error message (VBA)

G

Guest

I created a spreadsheet using Office 2003 on an XP machine that on open looks
at todays date and checks it against a shelflife date using this code:

TodaysDate = Date

When a colleague using Excel 2000 on a Windows NT (or 2000, not 100% sure at
the moment) tries to open up the spreadsheet they get an error saying:

Compile Error:
Can't find project or library

and it highlights the word Date (the one after the equals sign). I thought
this was a standard VBA keyword, so I don't understand why this is causing a
problem. Can anyone shed some light for me??
 
G

George Nicholson

You are missing a object library reference. The fact that Date() is
highlighted when the error message is generated does NOT mean its the VBA
library (it never is...). When this problem occurs what gets highlighted is
often random, misleading and meaningless.

In the VB editor: Tools>References. Something in the list will probably
appear as "MISSING" (and it won't be the VBA object library). If the missing
reference is not needed by existing code, uncheck it (if needed, it *may*
not let you uncheck it). If it is needed, find it, or the "current version"
equivalent, and try again.

Debug>Compile MyProject

HTH,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top