Delete EXD files to fix “Object library invalid” error

We have a Microsoft Word template that contains macros, which was working fine but all of a sudden in the last few days, whenever you invoke the template you get the following error:

Word has encountered a problem.

Word has encountered a problem.

If you open the template file instead of invoking a New document from it, you get a more detailed error:

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

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

 

This was obviously due to a change in our systems. After googling awhile, I found this article which explains that the error can happen after installing a certain Windows update: http://support.microsoft.com/default.aspx?scid=kb;en-us;932349. The update installs new versions of certain Visual Basic 6.0 Runtime files. The article provides a link to a cumulative update rollup which I tried, to no avail.

Upon further investigation, I found that the files had been updated fine. However, there is a corresponding EXD file that is created for each of the runtime files, when you use the controls provided by the runtime files in the Visual Basic designer. When the runtime files are updated, these EXD files are now invalid and hence this error occurs. To fix the error, you need to delete the EXD files and they will be re-created as needed.

These files should be located in the folder: %APPDATA%\Microsoft\Forms\

On Windows XP, it is usually located in:
C:\Documents and Settings\%USERNAME%\Application Data\Microsoft\Forms\

And on Windows Vista/7:
C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Forms\

EXD files

It was easy enough to fix for myself, but others were having this problem – so I made a script that given the username deletes the files. I had users run the script (you can post it as a link on a webpage and as long as you use Internet Explorer and low security settings it can be invoked from there):

// Function to delete EXD files from user Application Data folder
//     This is to resolve an issue with Word VBA macros that use VB runtimes, which the EXDs point to
function deleteEXDs(){
    var strToPath = "%appdata%\\Microsoft\\Forms\\";
    try {
		var fso = new ActiveXObject("Scripting.FileSystemObject");
		var shell = new ActiveXObject("WScript.Shell");
	}
    catch (err) {
        alert("Could not create ActiveXObject.\nThis script should be run from Internet Explorer, \n" + 
		      "with low security settings (e.g. Intranet or Trusted Sites).");
		return;
    }
    
    try {
		var appdata = shell.SpecialFolders("AppData");
		var strToPath = appdata + "\\Microsoft\\Forms\\";
		var fldr = fso.GetFolder(strToPath);
		var noEXDs = true;

		for (var e = new Enumerator(fldr.Files);  !e.atEnd();  e.moveNext())
		{
			if (fso.GetExtensionName(e.item()).toLowerCase() == 'exd')
			{
				noEXDs = false;
				try {
					var filename = new String(e.item());
					e.item().Delete();
					alert('DELETED ' + filename);
				}
				catch (err)
				{
			        alert("Error - could not delete " + e.item() + ".\nDescription: " + err.description);
				}
			}
		}
		
		if (noEXDs) alert('No EXD files found.');
    } 
    catch (err) {
        alert("Error - could not clean up EXD files.\nDescription: " + err.description);
    }
}

Edit 26 Oct 2010:
Thanks for all the positive comments!

I noticed that this solution of deleting the EXD files is now also being mentioned in the Microsoft KB article: http://support.microsoft.com/kb/957924/en-us

Edit 1 July 2011:
Thanks to the comment below by Paul M Edwards, I updated the script to use the AppData environment variable, so it should now work with Windows newer than XP.

This entry was posted in Technology and tagged , , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

284 Comments

  1. Ali
    Posted 2014/03/09 at 3:19 pm | Permalink

    Thank you very much
    This has helped me a lot

  2. Posted 2014/03/09 at 9:02 pm | Permalink

    Hi there, just became alert to your blog through Google,
    and found that it’s truly informative. I’m gonna watch out for brussels.
    I’ll be grateful if you continue this in future. Many people will be benefited
    from your writing. Cheers!

  3. Posted 2014/03/11 at 10:13 pm | Permalink

    Awesome! Its really amazing piece of writing, I have got much clear idea
    about from this article.

    Also visit my web page; Minecraft Pocket Edition Hack

  4. Posted 2014/03/14 at 9:51 am | Permalink

    This one-of-a-kind collectible and more available THIS WEEK
    ONLY. Also, since even the cheapest household that comes with
    the game can support two Sims, having your Sim get married normally does not cost
    anything. The popular application helps monitors your food and fitness,
    thereby helping you lose weight.

    Also visit my website :: sims freeplay cheats [http://www.youtube.com/watch?v=bf9rp5grjso]

  5. Posted 2014/03/15 at 11:15 am | Permalink

    What i do not understood is in fact how you’re no longer really much more
    neatly-liked than you might be now. You’re so intelligent.

    You realize therefore considerably relating
    to this subject, produced me in my view imagine it from numerous varied angles.
    Its like men and women aren’t involved unless
    it’s something to do with Girl gaga! Your individual stuffs
    nice. Always maintain it up!

    Feel free to visit my homepage; Arcane Legends Hack

  6. Posted 2014/03/15 at 1:02 pm | Permalink

    A essay on dota two treasure key hacks
    Even though a portion learned professors have abandoned hope of ever discovering reality behind dota 2 value key hacks, I for one feel that it must be still a worthy
    trigger for examination. In depth analysis with dota 2 treasure key
    hacks (http://Www.youtube.com) are an enriching experience.

    While much has been written on its influence on contemporary living,
    spasmodically it returns to generate a new passion amongst those that study its history.
    Mainly because was first compared to antidisestablishmentarianism much has become said concerning dota some treasure key hacks by the over 50, who may very well form a major stronghold with the inevitable battle for kisses
    and minds. In the light with this I will break down the issues to be able to give each
    of them the idea that they fully need

    Social Factors

    Society is often a human product. When The Tygers with Pan Tang
    sang ‘It’s lonely beginning. Everybody’s trying to do you in’ [1], they globalised a concern which had remained buried in the hearts of our
    ancestors since then. A child’s approach to
    be able to dota 2 treasure vital hacks provides standards with which we may judge this
    selves.

    When one is confronted with people of today your central theme emerges — dota 2 treasure vital
    hacks is either esteemed or despised, it leaves
    not a soul undecided. Just as fourteen weeks
    is the will return to its very own sick, society will return to dota
    2 treasure major hacks, again and again.

    Economic Factors

    We no longer live in a world which barters ‘I’ll present you with three cows for that will hat, it’s lovely.
    ‘ Our existance can be described as generation which cries ‘Hat — $20.

    ‘ We can study the Simple-Many-Pies model, which I hope can be familiar
    to most followers.
    Transport
    Costs

    dota 2 treasure key hacks

    There isn’t a longer a need to argue the significance of dota 2 resource key hacks,
    it is obvious to see that the results connect for themselves.

    The question which surfaces now could be, how? Recent studies
    indicate that transport costs global are driven entirely as a result of dota 2 treasure key hacks.
    Supply Side Economic Tax Cuts Tax deductions could end
    up a risky tactic.

    Politics Factors

    Machiavellian politics is normally rife. Are our commanders justified in
    pursuing in addition to maintaining political power? Comparing the ideals with the young with the truth felt by their elders is compared to contrasting dota 2 item key hacksism and post-dota two treasure key hacksism.

    Let’s consider the words of this silver tongued orator, the star of period and screen Bartholomew Bootlegger ‘Man’s greatest enemy is complacency in regards to personal and
    political good hygiene. ‘ [2] I claim that his insight into dota 2 treasure essential hacks provided
    the ideas for these great words. If dota 2 treasure key hacks are the
    food of politics, participate in on.

    Is dota 2 treasure key hacks politically accurate, in every sense?
    Each and every man, woman and to a lesser extent, child, must comprise their
    own mind.
    Conclusion

    To conclude, dota a pair of treasure key hacks provides,
    and will continue to be a major building block for ones world in which you
    live. It questions, stated a generation and figures show this can be a winning formular.

    As a parting shot here i will discuss the words of super-star Mariah Beckham: ‘I desire dota 2 treasure key hacks, nothing more
    nothing at all less.

  7. Posted 2014/03/18 at 7:24 pm | Permalink

    Hey! I’m at work surfing around your blog from my new iphone!
    Just wanted to say I love reading through your blog and look forward to
    all your posts! Carry on the excellent work!

  8. Posted 2014/03/19 at 9:16 am | Permalink

    I relish, cause I found exactly what I was taking a look
    for. You’ve ended my four day lengthy hunt! God Bless you man.
    Have a nice day. Bye

  9. Posted 2014/03/20 at 7:47 am | Permalink

    I could not resist commenting. Perfectly written!

    Feel free to visit my site Shadowgun Deadzone Hack – Rubye,

  10. Posted 2014/03/20 at 9:35 am | Permalink

    Former minor league baseball player turned filmmaker Ron Shelton wrote
    and directed “Bull Durham,” a movie considered the most realistic
    baseball movie ever made. With “Super Mario Galaxy” and “Super Mario Galaxy 2″ in
    tow, it’ll be interesting to see what jump the iconic Koopa-tossing plumber is bound to take next for his latest major outing.

    Meanwhile, only hours earlier, he had appeared happy and optimistic
    on the BBC’s Football Focus.

    Feel free to visit my site :: galaxy legend cheats (Margarette)

  11. Posted 2014/03/20 at 12:20 pm | Permalink

    When Star Wars had the go signal after initial talks with 20th Century
    Fox, George Lucas readily made his researches and he soon came
    out with the initial story. Surely you won’t be bored by the quests in Everquest II.
    Three years later, the ship lands in the farm town of
    Smallville where he is discovered by John (Glenn Ford) and Martha Kent
    (Phyllis Thaxter), who raise the child as their own and name him Clark.

    Here is my weblog; farm heroes saga cheats (Russell)

  12. Posted 2014/03/21 at 1:40 am | Permalink

    This in itself isn’t horrible–it is a pain to try to get on the
    normal website to chat using a browser. Double check your privacy settings to see what information is available.
    Especially for people with friends across different countries
    in the world, it’s a way to keep in touch without having to send mass
    emails that no one reads anyway.

  13. Posted 2014/03/22 at 1:33 pm | Permalink

    Pernell Whitaker bout at the Alamodome which amassed a crowd of
    59,995. Then obviously there are some major points to be awarded for completion of the game.

    This game brings to the series the well known DC characters such
    as Batman, Super – Man, Flash, Joker, Catwoman etc.

    Also visit my web site – hello hero cheats (Epifania)

  14. Posted 2014/03/22 at 3:57 pm | Permalink

    Several years passed and now Papa has placed advertising in the papers for a new wife and mother
    to his children. It’s an massive constructing getting tropical gardens stuffed with waterfalls, fountains additionally to
    a lagoon form swimming pool obtaining a pool bar.
    Follow it – picking up 20 pieces along the way – out of
    Wugachug.

    Feel free to surf to my homepage; Family farm seaside cheats

  15. Posted 2014/03/26 at 4:41 am | Permalink

    That is very interesting, You are a very skilled
    blogger. I have joined your rss feed and sit up for in
    quest of extra of your magnificent post. Also, I have shared yoiur site
    in my social networks

  16. Posted 2014/03/26 at 9:18 am | Permalink

    (The film was shot on Santa Catalina Island, where the cast stayed during
    the production. Why is it that the screen Chinese is always the villain.
    Anna May Wong, a third-generation Chinese-American, managed to have a
    substantial acting career during the deeply racist times that were the 1920s through
    the early 1960s.

    Here is my web page; heroes of dragon age cheats (Melvin)

  17. Posted 2014/03/26 at 6:17 pm | Permalink

    Thank you a bunch for sharing this with all people you actually recognize what you are speaking approximately!
    Bookmarked. Please additionally consult with my
    site =). We may have a hyperlink alternate contract etween
    us

  18. Posted 2014/03/28 at 12:11 am | Permalink

    Hi, this weekend is good in favor of me, because this
    time i am reading this enormous informative post here at my house.

    Look into my web site; modern combat 4 zero hour hack (Emanuel)

  19. Posted 2014/03/28 at 2:32 am | Permalink

    What’s up Dear, are you genuinely visiting this site on
    a regular basis, if so after that you will absolutely
    obtain good know-how.

  20. Posted 2014/03/28 at 11:01 pm | Permalink

    Hello there, I discovered your blog by means of Google whilst
    searching for a related topic, your site came up, it looks good.
    I’ve bookmarked it in my google bookmarks.
    Hi there, simply turned into aware of your blog through Google,
    and located that it’s truly informative. I’m going to watch out for brussels.

    I will appreciate in the event you continue this in future.
    A lot of people will be benefited out of your writing.
    Cheers!

    Also visit my web blog – Castle Age Hd Hack Ios

  21. Posted 2014/03/30 at 1:17 am | Permalink

    I know this site presents quality based articles
    or reviews and additional data, is there any other website which presents these data in quality?

    Here is my blog – The Respawnables Hack

  22. Posted 2014/03/30 at 1:28 pm | Permalink

    I absolutely love your blog and find almost all of your post’s to be exactly I’m
    looking for. Would you offer guest writers to write content for
    yourself? I wouldn’t mind composing a post or elaborating on
    a lot of the subjects you write in relation to here. Again,
    awesome web site!

    My web site PlanetSide 2 Station Cash Generator

  23. Posted 2014/03/31 at 8:18 pm | Permalink

    Thanks for finally talking about > Delete EXD files to fix

  24. Posted 2014/04/04 at 1:26 am | Permalink

    And then there are those times when writing takes a lot more effort.
    Youu see, SEO coplywriting isn’t a mythical beast; it’s just plain, straightforward writing.
    A website which is on the first page of a leading search engine is preferred and normally judged above the others.

  25. Posted 2014/04/04 at 1:34 am | Permalink

    So as to modify the content the website, the company should primarily know who their end audiences are and
    what keyword phrases do they utilise when they are seeking to a find a specific website.
    8 million and rob lives of at least 76 people and caused
    a dozen of others injured. It’s time to think strategically about SEO and
    socia media, your audience will benefit from it and the search engines willl love you.

  26. Posted 2014/04/04 at 2:05 am | Permalink

    Notable SEO experts at have experience of different approaches to SEO and hold insight
    into the algorithms of various search engines. They have proven to be
    worthy to businesses around the world by providing them with alternative methods for
    marketing. It’s time to think strategically about SEO and social media,
    your audience will benefit from it and the search engines will love you.

  27. Posted 2014/04/04 at 2:11 am | Permalink

    This seemed odd to me so I decided to look further into the matter and
    write an article about what I found. For example, as a private investigator, what keywords would
    you expect your potential clients to enter in order to find you.
    The bots often spider web (the most widely used of these).

  28. Posted 2014/04/09 at 8:56 pm | Permalink

    Thank you for the good writeup. It in reality used to
    be a amusement account it. Look complicated to more brought agreeable from
    you! However, how can we keep in touch?

    Here is my weblog … Boom Beach Hack (http://www.pinterest.com)

  29. Posted 2014/04/11 at 10:26 am | Permalink

    Hello! This is my 1st comment here so I just wanted to give a
    quick shout out and say I genuinely enjoy reading your articles.
    Can you suggest any other blogs/websites/forums that deal with the same subjects?
    Thanks a lot!

  30. Posted 2014/04/11 at 4:04 pm | Permalink

    Hello colleagues, fastidious piece of writing and pleasant urging commented at this place, I am in fact
    enjoying by these.

  31. Posted 2014/04/14 at 12:14 am | Permalink

    believe the review s important, th idea provdes th purpose: restrict spammers ver
    ued your tool, t mght bring bout video game server correct t faster also it woul not function.
    You may call up the sender and verify if you sense something suspicious in the mail.
    It may be difficult to remember multiple passwords, but using the same password
    on different sites can make you an easy target of
    hackers.

  32. Posted 2014/04/15 at 1:36 pm | Permalink

    He combines the two to become a drug kingpin on a first-name basis with Sosa, nabs Michelle Pfiefer and destroys
    everything in his way. 3 Gingerbread, the latest version
    of the Android OS. Well, it’s definitely not December, I can tell you that much.

  33. Posted 2014/04/16 at 2:32 pm | Permalink

    I’ve been exploring for a little bit for any high quality articles or blog posts in
    this kind of house . Exploring in Yahoo I finally stumbled upon this web site.
    Reading this information So i’m satisfied to convey
    that I have an incredibly good uncanny feeling I found out just what I needed.
    I such a lot no doubt will make sure to don?t overlook this web
    site and provides it a look regularly.

    My website … Imvu Credits Hack

  34. Posted 2014/04/17 at 4:09 am | Permalink

    Like I told my friend recently, I’m a dirty slut — saved by God’s grace
    alone. Disgaea: Hour of Darkness (Nippon Ichi) Even though
    it claimed IGN’s Best Game No One Played Award, Disgaea gained immense popularity, so much so that Nippon Ichi was
    forced to re-release the title. Presented
    in a comic book theme, the Battletoads rappelled down buildings, rode hover boards, and bashed baddies with oversized appendages.

    My web blog hello Hero cheats

2 Trackbacks

  1. [...] deleting the mscomct2.exd file as mentioned in this two sites “Microsoft” and “lessanvaezi” but the error stil pops. I checked and the new .exd file was generated.Some Additional [...]

  2. [...] [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting