Excel 2010 "Object libraray invalid..."

"Object library invalid or contains references to object definitions that could not be found"

I have Windows XP OS. Recently, I upgraded Ms Office to 2007 and then again upgraded to Office 2010 professional version. I had a excel macro based tool which i had created in 2003 version. I could use it in Office 2007 version but now I am not able to use it in Office 2010 version. I simply get the "Object library invalid..." error when I try to run the macro.

I wonder if I am missed something during the installation process.

Your help would be greatly appreciated in resolving this issue. - RazorEdge

 

* Please try a lower page number.

* Please enter only numbers.

* Please try a lower page number.

* Please enter only numbers.

Open the workbook containing the macro(s), then in the Visual Basic Editor check Tools | References...  See anything listed as 'missing?'  That might be one clue.  Among the checked references, are there any to something other than Excel, VBA, MSForms, Office?  If so, maybe it is one of those that need some upgrade TLC.
Tushar Mehta (Technology and Operations Consulting)
www.tushar-mehta.com (Excel and PowerPoint add-ins and tutorials)
Microsoft MVP Excel 2000-Present
Tushar Mehta (MVP Excel 2000-2015)
Excel and PowerPoint tutorials and add-ins
www.tushar-mehta.com

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Thanks Tushar,

I have the following checked in the references,

Visual Basic For Applications
Microsoft Excel 14.0 Object Library
OLE Automation
Ms Office 14.0 Object Library
Ms Forms 2.0 Object Library

..Still not sure!

 

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

The key thing to take from Tushar's message is... see if anything was marked "Missing". If so, put a check mark in its checkbox. If not, then your problem lies elsewhere.
*** PLEASE READ ***

If this response answers your question, please mark it as the "Answer".

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Under tools I did find a missing calendar OLE and eliminated both that message, the form using it and all the calls to it. Still get the message at compile and I am still baffled to what else it could be.

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Any other ideas on this?   I the same error with an excel macro file that ran and compiled fine on Excel2007.   

I have tried unselecting references, one by one and trying to compile but still get the error.

The only 4 remaining selected references (which I'm unable to unselect because excel complains that they are in  use) are:

Visual Basic For Applications
Microsoft Excel 14.0 Object Library

Ms Office 14.0 Object Library
Ms Forms 2.0 Object Library

At this point I'm suspecting that there is some issue with Forms 2.0 and Excel 2010.

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

I also ran into this problem. In my case, it was inside a PowerPoint 2010 macro that I was updating from PowerPoint 2003. I received the "Object Library Invalid..." error, and like previous posters here, did not find any MISSING references. I was able to work my way out of this problem in the following manner. Perhaps this could help someone else:

1. One by one, I double-clicked on each of the forms in my project explorer. Some forms opened, and others caused the "Object Library Invalid" error to appear.

2. For the forms that triggered the error, I did the following:

  • I right-clicked on the form name in the project explorer, and chose "View Code"
  • I hit F5 to run the form
  • The "Object Library Invalid" message came up again
  • Now, for some reason, I was able to right-click on the name of the form in the project explorer, choose "View Object", and see the form
  • There were three forms in my project that triggered the error. Once I was able to see them, I noticed that they all had a ProgressBar control.
  • I went through and deleted all ProgressBar controls, and I was able to compile the project

 

After some experimentation, I saw that the ProgressBar control was not working, even when I dragged a fresh one onto the form. I "rolled my own" progress bar with a label within a frame, and this solved my issue.

It may not be a ProgressBar in your case, but if you are still stuck, try experimenting using the steps above. It may help you find the culprit.

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

As the previous posts hint, this problem is caused by a broken reference. The problem here is that Excel 2010 does not explicitly show it and simply crashes.

 

The crash is so bad, that the file cannot be saved in Excel 2010 format (.xlsm) or in the native .xls (97-2003 format).

 

As Sunnyside reports, the problem can be linked to the Progress Bar control, although this is not the only one that resides in the broken reference. These are the steps to fix the problem:

 

1. Open the .xls file in question and click OK after getting the error mentioned above.

2. Open the Visual Basic Editor (Alt+F11)

3. Open (if they are not already open) one of the modules or code behind forms

4. Click on Tools / References...

5. In the pop-up window click on Browse...

6. Navigate to [Your Windows Directory]\System32 (it may open by default)

7. Type MSCOMCTL.OCX (you'll see it in the auto-select options before you finish typing)

8. Click Open and the reference will appear as Microsoft Windows Common Controls 6.0 (SP6)

9. Click on Debug\Compile VBAProject to verify that the problem is solved

10. Save the file.

 

As mentioned above, this could happen for other controls as well, but the progress bar seems to be the most popular.

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

I realize this is an older post, but this happened to me after applying some office updates.  I found this link which helped me.

 

http://www.lessanvaezi.com/delete-exd-files-to-fix-object-library-invalid-error/

 

Essentially VB modules get upgraded, but some older files are left behind that cause the error.  If you delete them, they will be re-created as needed and the error will go away.

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Thanks so much for the help, it was a perfect solution. The error message has been very annoying.

 

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

just unregister "MSCOMCTL.OCX" and then register it, it will solve the issue.
32-bit OS C:\Windows\System32\MSCOMCTL.OCX
64-Bit OS C:\Windows\SySWOW64\MSCOMCTL.OCX

2 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

* Please try a lower page number.

* Please enter only numbers.

* Please try a lower page number.

* Please enter only numbers.

 
 

Question Info


Last updated January 17, 2024 Views 21,269 Applies to: