Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 2nd, 2007, 02:16 AM
Registered User
Join Date: Aug 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default compile error: can't find project or library

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??

Old August 2nd, 2007, 06:12 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 173
Thanks: 0
Thanked 3 Times in 3 Posts


Sounds like you've got a missing reference in your code on your friend's computer. You are quite correct that DATE is a core VBA function (part of the DateTime class) and the only time I've seem things go buggy like this is when there are missing references in the project.

Could you get your friend to check the references to the code of your spreadsheet (Found in Tools -> References... of the VBE)? There should be a checklist of references there. If any of them start with "MISSING:"... then your friend will need to uncheck those references and possibly recheck the correct versions as required to get your code running.

The most likely initial cause of this is use of early binding in your code. If you intend to distribute excel spreadsheets with VBA code to users running other set-ups you're probably best converting to late binding.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't Find Project Or Library jonny10 Excel VBA 1 November 30th, 2006 07:00 AM
VB compile error: can't find project or library bambam Beginning VB 6 2 November 16th, 2006 03:16 PM
Can't find Project or Library. dpkbahuguna Beginning VB 6 1 September 7th, 2006 07:18 PM
Compile error(Can't find project or library) shamala Excel VBA 1 February 21st, 2006 04:10 AM
Solution Excel's can't find the project or library Born2BFree Excel VBA 0 October 21st, 2005 11:49 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.