Re: Interop uninstall ?? Runtime Error -2147310770(8002801d): Automation Error. Library not Installed; Word 2003
Robert Taylor <[email protected]> Sat, 30 May 2009 10:08:50 +0100
| Newsgroups | gmane.comp.windows.devel.dotnet.advanced |
|---|---|
| Message-ID | <005401c9e106$3fe4ea70$bfaebf50$@com> |
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:[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