Help and Support
 

powered byLive Search

ACC: VBA Functions Break in Database with Missing References

Article ID:160870
Last Review:January 19, 2007
Revision:3.1
This article was previously published under Q160870
Moderate: Requires basic macro, coding, and interoperability skills.

On This Page

SYMPTOMS

If you have a procedure that contains a Visual Basic for Applications function, and your database contains a reference to a missing object library or type library, you may receive the following error message when you compile your modules or run the procedure.

Back to the top

In Microsoft Access 97, Microsoft Excel 97, Microsoft Word 97


Compile Error:
Can't find project or library

Back to the top

In Microsoft Access 7.0


Can't find project or library

Back to the top

CAUSE

Your database contains a reference to a database, type library, or object library that is marked as "Missing:" in the References dialog box.

Back to the top

RESOLUTION

Follow these steps to remove the missing reference:
1.Open your database.
2.Open a module in Design view.
3.On the Tools menu, click References.
4.Click to clear the check box for the type library or object library marked as "Missing:."
An alternative to removing the reference is to restore the referenced file to the path specified in the References dialog box. If the referenced file is in a new location, clear the "Missing:" reference and create a new reference to the file in its new folder.

Back to the top

MORE INFORMATION

Steps to Reproduce Behavior


1.Open the sample database Northwind.mdb.
2.Create a new module.
3.On the Tools menu, click References.
4.Click Microsoft Excel 8.0 Object Library (or Microsoft Excel 5.0 Object Library if you have Microsoft Excel 7.0) in the Available References box, and then click OK.
5.Create the following procedure in the module window:
      Function Test(x as string)
         Msgbox Left(x, 5)
      End Function
						
6.Save the module as Module1, and then close the database.
7.If you have Microsoft Excel 97, rename the file Excel8.olb to Excel8a.olb. This is the Microsoft Excel 8.0 Object Library file, which is installed by default in the C:\Program Files\Microsoft Office\Office\ folder.

If you have Microsoft Excel 7.0, rename the file Xl5en32.olb to Xl5en32.xyz. This is the Microsoft Excel 5.0 Object Library file, which is installed by default in the C:\MSOffice\Excel folder.
8.Open the sample database Northwind.mdb.
9.Open Module1 in Design view.
10.On the Debug menu (or the Run menu in Microsoft Access 7.0), click Compile Loaded Modules. Note that you receive the error message.
11.Click OK in the error message box, and the References dialog box opens automatically. Note the word MISSING: in front of the Microsoft Excel Object Library.
12.Click Cancel in the References dialog box, and then close the database.
13.Rename Excel8a.olb to Excel8.olb (or rename Xl5en32.xyz to Xl5en32.olb).
14.Repeat steps 8 through 10 and note that the error message no longer appears.

Back to the top

REFERENCES

For a complete list of Visual Basic for Applications functions, search the Help Index for "functions, reference topics," or ask the Microsoft Access 97 Office Assistant.

Back to the top


APPLIES TO
Microsoft Access 95 Standard Edition
Microsoft Access 97 Standard Edition
Microsoft Excel 97 Standard Edition
Microsoft Word 97 Standard Edition

Back to the top

Keywords: 
kbprb KB160870

Back to the top

Article Translations

 

Other Support Options

  • Need More Help?
    Contact a Support professional by Email, Online or Phone.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.