[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2196
  • Last Modified:

Word automation (Word.ApplicationClass, TYPE_E_LIB_NOTREGISTERED)

Hi!

I have an .NET app on many machines at customer's office. App is doing some word automation (opening a document and doing a search replacing on some keywords).

Recently one machine was completelly reinstalled with Word 2003 SP3, Windows XP (all updates).

Now I get this exception:

System.InvalidCastException: Unable to cast COM object of type 'Word.ApplicationClass' to interface type 'Word._Application'. This operation failed because QueryInterface call on the COM component for the interface with IID '{...}' failed due to the following error: Library not registered (Exception from HRESULT: 0x8002801D (TYPE_E_LIB_NOTREGISTERED))

at this line in code:

Word.ApplicationClass WordApp = new Word.ApplicationClass();


I tried to change that to:
Word._Application WordApp = new Word.ApplicationClass();

but of course that didn't work..

Please help !
0
davidhq
Asked:
davidhq
  • 2
1 Solution
 
davidhqAuthor Commented:
additional info:

I see "Office 2007 primary interop assemblies" under Add/Remove programs.. this is strange, because the office installed is "Microsoft Office Professional Edition 2003"

thanx again
0
 
davidhqAuthor Commented:
hmm yes.. uninstalling PIA solved the issue!
0
 
Vee_ModCommented:
Closed, 0 points refunded.
Vee_Mod
Community Support Moderator
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now