Microsoft KB Archive/110755

= Deleted Project or Library Listed Twice In References =

Article ID: 110755

Article Last Modified on 10/11/2006

-

APPLIES TO


 * Microsoft Excel 95 Standard Edition
 * Microsoft Excel 5.0c

-



This article was previously published under Q110755





SYMPTOMS
If you delete a project (.XLS, .XLA) or library (.OLB) file from the hard drive that is referenced by a Visual Basic module, the project or library may be listed twice in the Available References list for the Visual Basic module (even when you close and reopen the workbook that contains the reference). This behavior may also occur if you move a project or library to a directory on the hard drive other than the directory you installed Microsoft Excel to, or to a directory that is contained in your path statement in the AUTOEXEC.BAT file.

This behavior does not create a problem, but it may be confusing.



CAUSE
You may encounter the above behavior if you delete a referenced project or library from the hard drive in the same session of Microsoft Excel while the workbook containing the reference is closed, and if all of the following conditions are true:
 * The referenced project or library, and the project that references it are located in different directories. -and-


 * The project that references the project or library is located in a directory that is not contained in your path statement and is not the directory to which you installed Microsoft Excel. -and-


 * The referenced project or library is located in your Microsoft Excel directory, or a directory that IS contained in your path statement.



WORKAROUND
To remove the "extra" reference to the missing project or library, you must exit Microsoft Excel.

NOTE: If the first reference to the missing project or library contains the prefix "MISSING:", you can resolve this problem by clearing the check box next to that reference.



MORE INFORMATION
In a Visual Basic module, you can use the References command on the Tools menu to add a project or library as a reference to your module. This allows you to access information in the project or library directly from your module. For example, if you add the project TASK.XLS to a module in BOOK1.XLS using the References dialog box, you can run any procedure contained in TASK.XLS from any module in BOOK1.XLS using only the procedure name.

When you add a project or library to a module using the References dialog box, the project or library is added to the Available References list and the check box next to the reference is selected. The added project or library remains available to the workbook you added it to unless you clear the check box manually from the Available References list, or you move or delete the project or library from the hard drive.

When you open a workbook that contains references to a project or library, Microsoft Excel first searches for the project or library in the directory the project or library was located when you added it. Then the following directories are searched (not necessarily the exact order):
 * The directory in which you installed Microsoft Excel
 * The directory in which the workbook containing the reference is located
 * Directories that are in your path statement in the AUTOEXEC.BAT file

No Reference Found
If the project or library is not found, it is listed with the prefix "MISSING:" in the Available References list. If the project or library is not found in the same session of Microsoft Excel that it was added, and the conditions listed above are true, the reference will be listed a second time and the check box next to it will be cleared.

Another Reference Found with Same Name
If the project or library is not found, but a project or library with the same name is found in a directory in the search order listed above, the found project or library replaces the previous one in the Available References list. If the project or library is not found in it's original location in the same session of Microsoft Excel that it was added, and the conditions listed above are true, the reference will be listed a second time and the check box next to it will be cleared.

