Re: Interop uninstall ?? Runtime Error -2147310770(8002801d): Automation Error. Library not Installed; Word 2003

John Warner <[email protected]> Sat, 30 May 2009 10:47:09 -0400
Newsgroups gmane.comp.windows.devel.dotnet.advanced
Organization House
Message-ID <0a5801c9e135$8294b5b0$87be2110$@com>
It seems after I frankly found the PIA for Office 2007 right in Programs and Features or whatever it's called in Vista that I could uninstall it. Others might want to make a mental note that if you are trying to automate Word 2003 and the PIA for Office 2007 is present you will have issues. The cure is removing the PIA. That is the only thing I did and now I get no errors running the same code that the day before would not run. This seems like a serious issue for MS to look into but they have no method for reporting bugs that does not involve me betting some serious money that it is a bug and so they won't charge me for a tech support contact. So alas it will go unreported because MS does not actually care that this issue exists.

Regardless of my rant about MS not caring about defects, this only appears to affect Word and not Excel. You can reproduce this by simply taking a machine with Office 2003 installed, write a bit of code to invoke a couple of properties in Word and run it. Then install the Office 2007 PIAs and the same code will now be broken.

Thanks to all who offered help. 

John Warner


> -----Original Message-----
> From: Discussion of advanced .NET topics. [mailto:ADVANCED-
> [email protected]] On Behalf Of Robert Taylor
> Sent: Saturday, May 30, 2009 5:09 AM
> To: [email protected]
> Subject: Re: [ADVANCED-DOTNET] Interop uninstall ?? Runtime Error -
> 2147310770(8002801d): Automation Error. Library not Installed; Word 2003
> 
> I've been working on an Office add-in and found that when you install an Office
> product it will install the PIA for that product in the GAC. If you add-in was for,
> say Word and Excel but the user only had Word installed then it's likely that it
> will throw a COM exception as the Excel PIA will not be installed.
> 
> If you install the PIAs from the MSFT PIA msi package then it only installs the
> PIAs for apps you have installed.
> 
> When you install VSTO it installs all the PIAs (in the GAC) so your dev
> machine will always work even if you only have one Office app installed.
> 
> If you build a setup project for your add-in then all the PIAs it references are
> added to the setup, but as I understand it, you can't 'redistribute' these PIAs so
> have to exclude them from your setup. So, to stop the add-in throwing a COM
> Exception you then have to place a try...catch round any statement that
> references a PIA class; like "if (application is Word.Application)" to stop it
> crashing your add-in.
> 
> Robert Taylor
> -----Original Message-----
> From: Discussion of advanced .NET topics. [mailto:ADVANCED-
> [email protected]] On Behalf Of John Warner
> Sent: 29 May 2009 13:29
> To: [email protected]
> Subject: [ADVANCED-DOTNET] Interop uninstall ?? Runtime Error -
> 2147310770(8002801d): Automation Error. Library not Installed; Word 2003
> 
> I have a bit of a problem. I need to automate some things in Word 11/2003.
> The problem I'm having is I keep getting an Interop error from the Word COM
> linkage that the Word COM library is not installed. Surfing the net most of the
> afternoon yesterday and trying some suggestions that did not work I found one
> that makes a little sense to me. VS 2008 by default seems to install the
> Interop(s) for Office 2007/12. The comment was there is some sort of bug that
> breaks linking to Word 11 (and only Word in my case as I can run Excel 2003
> from VS 2008 code with no issues) due  to the Interop for Office 12 being
> present. As I read the post, get rid of the version 12 Word Interop (since Word
> 2007 isn't installed on my dev machine anyway) and my Word 11 automation
> problems will go away.
> 
> I've tried re-registering Word (Winword.exe /r) and that did not help. I tested
> with VB6 and get a similar error from COM. So as a last gasp, can anyone
> here tell me what I need to do to un-install the Office 12 Interop(s)? Note OS =
> Vista Business
> 
> I'm also open to any other ideas
> 
> Sorry for this being slightly off topic but I figured this might be the best place for
> the information I need.
> 
> Thank you.
> 
> John Warner
> 
> ===================================
> View archives and manage your subscription(s) at
> http://peach.ease.lsoft.com/archives
> 
> ===================================
> View archives and manage your subscription(s) at
> http://peach.ease.lsoft.com/archives

===================================
View archives and manage your subscription(s) at http://peach.ease.lsoft.com/archives