Excel 2007 :: object library invalid or contains references to object definitions that could not be found.

Posted on 2009-04-19
Last Modified: 2012-06-27
I am trying to use an excel Add-In (Wonderware Active Factory 9.2) and it doesn't work.

When I start EXCEL I always get the following message:

Compile Error:

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

I've done quite a lot of searches here and in google and not found anything that could help me...

I've already tried to uninstall Office 2007 and install it back without any luck.. .always the same error.

I have the same thing running correctly on another computer, I've checked the References on both computers are the same and same DLL versions... I'm kind of desperate with this... I am convinced that If I fully reinstall the computer it will work... but it's a pain in the ass doing it because I ave a lot of stuff on this computer...

Is there any way to knwo WHICH object has the problem? That may help me to fix the thing...

Thanks in advance for the answers that are going to come :--)
Question by:liceran
    LVL 13

    Expert Comment

    by:Brian Withun
    1) You can remove all traces of the addin by first de-activating the addin, then going to the addins folder and removing the actual addin itself.

    If the addin is named *.xla, then it was written in an earlier version of excel.  I think 2007 uses .XLAM

    2) Once you have removed the addin, close and re-open excel.  Verify that the add-in is no longer appearing in the AddIn manager.

    3) Next restart your computer (probably not necessary, but with MS it never hurts)

    4) Start Excel again, make sure your error isn't still happening (in which case it's NOT the wonderware addin doing it)

    5) Now close excel, put your addin back into the addins folder, and relaunch excel.

    6) After excel launches, goto the addins manager and re-activate the addin.

    7) Close and restart Excel.

    Have your errors gone away as of #4 above, and re-appeared in #7?

    If the errors still happen, I'm guessing that the add-in is referring to missing files.
    Look at what addins exist and are activated on the 'addins' manager.

    Make sure the non-working computer has the same addins installed and activated (such as the VBA Extensions for Analysis Toolpak if it's an older style *.xla addin)


    Author Comment

    bhwithun, thanks for your time... but this does nto address the issue.

    The only Add-in activated is the one it's causing the problem (on both computers).

    What you wrote here is something very basic, I already did few times...

    Missing file?--- yep maybe... but the question is... Is there any way to know which object in the VBA code is causing the problem?...

    Anybody else?
    LVL 13

    Expert Comment

    by:Brian Withun
    I'm assuming your AddIn is password protected, in which case your debugging options are few.

    Have you confirmed that the addin is not viewable?

    Author Comment

    The add-in is not password protected, the code is viewable.

    Trying to compile it I get the same error always, but it is not pointing to anything in particular.
    LVL 13

    Expert Comment

    by:Brian Withun
    Press Alt-F11 to open the visual basic editor.

    From there,

    Debug > Compile VBAProject

    If there is a compile error, you say it's not highlighting the offending line?

    I've seen that happen occur if there is a syntax error in the structure of the code.  Excel cannot determine where the problem is because it can't make sense of what it's compiling.  Maybe a sub is being defined inside another sub due to an accidentally deleted "End Sub" statement...

    What I've done to resolve it is to begin commenting out entire functions, sub, and other constructs.
    Eventually you will comment out the part which has an error, and the compiler error will vanish.

    Then you just need to inspect the last thing you commented out, looking for that elusive syntax error.


    Author Comment

    mmmmm.... This is not the way to go. The reason is VERY simple, the same Add-In is working on another computer... Just to be sure I directly copied the XLAM file... so, definitively  it is not what you are saying.
    LVL 13

    Accepted Solution

    It is working on the _other_ computer.
    _This_ computer is missing something.

    Find out what it is by discovering the line of code that calls the _missing_ thing.

    You can go through the code line by line and verify the type of every variable, then track down the origin of the implementation of that type and you will eventually figure it it out.  This is the hard way.

    Or _try_ commenting it out module by module.  Eliminate the code that IS working, and get to the code that ISN'T working.  This is the easiest way I know.

    If you'll upload the addin I may be more directly helpful.  Other than that, all I can give you are debugging tips, which I have done.

    Best of luck to you.

    LVL 85

    Expert Comment

    by:Rory Archibald
    I assume this comes with an installation routine - did you run that, or did you simply copy the .xlam file from one machine to another (in which case any associated libraries would not be installed or registered properly)?

    Expert Comment

    I had a really similar situation and this worked for me...

    I only had to do the stuff under the "On Client Computer" section. Dumped the .exd files, downloaded the cabs and then registered the ocx files.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    A2 = A1 That kind of cell reference is relative.  If you copy it from A2 to B2, then B2 will get this: B2 = B1 That's all fine and good, but if you then insert a new row above row 2, you'll find: A3 = A1 B3 = B1 This is intentional. …
    This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
    This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
    This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now