What to do if you get the "Object Library Invalid Error Message"

What is it ?

If you open an Office Document, you might occassionally find yourself with an error that tells you that your "object library is invalid" , "excel has had a catastrophic failure" or you have an "invalid reference". Once you have this, you cannot save the file, and depending on the version, Excel or some other office program will just exit. Even opening it in safe mode doesn't help.

When do you get it ?

Almost certainly you will have just have had some kind of windows or office update that will have changed one or more of the libraries and controls that Office uses.

Why does it happen ?

When you access some files, Windows makes cached copies (called an .exd file). Amazingly, the Windows update process does not clean these .exd files, so that means that the cached file may be out of synch with the new version of the library - eventually you end up with the error and you think you can't do anything to recover the document you are working on. But you can, because there is nothing really wrong with your document at all.

How to fix it.

It's very easy to fix - just delete all the .exd files you can find. They will recreate themselves with the new versions of the controls and libraries that have just been installed. For details, see this post from 2009 by Lessan Vaezi.


Incredibly, this same error continues to plague Office Users. There is no excuse for it. It is well known by Microsoft - they should be extra careful when they push updates that can have this kind of effect. See Get Started Snippets for more topics like this.  In the meantime why not join our forum,follow the blog or follow me on twitter to ensure you get updates when they are available.

You want to learn Google Apps Script?

Learning Apps Script, (and transitioning from VBA) are covered comprehensively in my my book, Going Gas - from VBA to Apps script, available All formats are available now from O'Reilly,Amazon and all good bookshops. You can also read a preview on O'Reilly

If you prefer Video style learning I also have two courses available. also published by O'Reilly.
Google Apps Script for Developers and Google Apps Script for Beginners.