Compile Error when referencing library

M

Mike Kosty

I get the following error when running a module in VBA:

"Compile Error: Can't find project or library"

Thing is, it happens randomly. Sometimes it works,
sometimes it doesnt. I've relinked the library (MS Office
9.0 Object Library), but the References box still lists
the library as missing. Its there, I can look at it on
the harddrive, but it still doesnt work.

MS Access 2000
 
D

david epsom dot com dot au

1) It is often a good idea to get rid of the reference
to the Office library and use GetObject/CreateObject
instead of New, and 'as object' instead of 'as word.doc'
just so that you don't get general VBA problems when
the reference is 'missing'

2) Sometimes, it is a good idea to write code with
explicit references to the relevant library: 'dim
frm as Access.Form', 'vba.vbcrlf', 'vba.msgbox'

3)If the file is there, but the reference is 'missing',
then the file is corrupt or incorrectly installed.

(david)
 

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