When using ms excel document that assimilate functions or buttons which need VBA (Visual Basic Applications) for the macros to perform some assigned task, the user may get a compilation error “can’t find project or library”.
What is the cause of this Error?
- This error is usually caused by the user’s excel program. The reason is that the program has the reference to an object or type of library which is missing and hence not found by the program. So the program is unable to use VB or Micro based functions or buttons. This leads to error message appearance.
- Since there are standard libraries so missing library sounds a bit of least chance. Other reason to this, in that case is that library miss-match occurs. For example: the user may have a library version of 2007 but the reference in the code may be looking for 2010 version of that specific library. So the program fails to find the corresponding library thus issuing the compilation error.
- Sometime a library may be toggled on or toggled off which causes a missing link issue between the library and program code. Therefore the compilation error occurs.
- Another reason of the error message is concerning about the use of Microsoft XP which include a reference to web service in VBA project. When you run this project in MS office 2003, same compilation error appears. The reason is same i.e. object or type of library is missing (or not found).
Most likely, the application has lost reference to an object or type library resulting in the above error when using barcode macro and native VBA Functions.
Please follow these steps to resolve the issue:
- Open the Microsoft Access or Excel file that is giving you the error message.
- Make sure the Excel sheet or Data sheet that has the buttons or functions in question is selected.
- Simultaneously press theALT and F11 keys on your keyboard to switch to the Visual Basic Editor in a new window (as seen below).
- In the newVisual Basic Editor window, click on the Tools menu at the top of the screen, and then click ..
- AReferences dialogue box will display on the screen. A missing type or object library is indicated by “MISSING:” followed by the name of the missing type or object library (an example is MISSING: Microsoft Excel 10.0 Object Library, as seen below).
- If there is a check mark in the check box next to the missing type or object library, thenun-check the check box.
- Click OK.
- Exit the Visual Basic Editor.
- Save the original Access or Excel file.
- Try using the buttons or functions in question that previously didn’t work and they should now work normally.
Alternative to remove the reference is to restore the referenced file to the path specified in the references dialog box. If the referenced file is in new location, clear the “Missing:”reference and create a new reference to the file in its new location.
Fully automatic resolution:
The above mentioned manual solution will most probably sort out the issues and mentioned errors from Excel file. But for any other corruption or file damage most suitable option would be to make use of MS Excel Repair Tool. This is is highly competent in restoring corrupt Excel files and also retrieves data from worksheet like cell comments, charts, other data and worksheet properties. This is professionally designed program that can easily repair .xls and .xlsx files.
Steps to fix the corrupt excel file:
Step 1: To start the process, download and install MS Excel repair Tool and then select “OK” button.
Step 2: By clicking on “Select file” button, select the corrupt .xls or .xlsx file. In order to search an .xls or .xlsx file in specific folder click on “Select folder”. In a particular drive in order to search an .xls or .xlsx file click on the “Search file” button
Step 3: After selecting the corrupt file click on “Scan” button to begin the scanning process.
Step 4: After selecting the corrupt file click on “Scan” button to begin the scanning process.
Step 5: After the scanning is finished, you can preview your corrupt file from the right panel.
Step 6: Hit on the “repair” button to begin the repair process.
Step 7: Select the desired location to save the repaired excel file and after that hit on “OK”.