Advertisement

12.07.2007 at 12:10AM PST, ID: 23008121
[x]
Attachment Details

Word automation (Word.ApplicationClass, TYPE_E_LIB_NOTREGISTERED)

Asked by davidhq in Microsoft Office Suite, .NET, C# Programming Language

Tags: , , ,

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 !Start Free Trial
[+][-]12.07.2007 at 12:20AM PST, ID: 20426088

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.07.2007 at 12:28AM PST, ID: 20426105

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Office Suite, .NET, C# Programming Language
Tags: type, com, interface, word
Sign Up Now!
Solution Provided By: davidhq
Participating Experts: 1
Solution Grade: B
 
 
[+][-]01.30.2008 at 04:44AM PST, ID: 20776512

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_EXPERT_20070906