Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005.

363 views
Skip to first unread message

stapes

unread,
Oct 12, 2010, 9:24:49 AM10/12/10
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Hi

I have built a website that writes into a Word Document template. It
works fine on my development machine, but when I move it to the live
server, it crashes with the following error:

Retrieving the COM class factory for component with CLSID
{000209FF-0000-0000-C000-000000000046} failed due to the following
error: 80070005.

My aspx.cs page has the following:
using Microsoft.Office;

In the /Bin folder is the dll file office.dll and interop.word.dll

In the add reference (using Visual Studio 2005) there is Microsoft
Office 11.0 Object Library and Microsoft Office 12.0 Object Library
and Microsoft Word 11.0 Object library.

I found a webpage that accurately describes my problem:http://
www.computerperformance.co.uk/Logon/code/code_80070005.htm#Solution_to_error_80070005_with_COM_component

I don't understand the answer.

Stephen Russell

unread,
Oct 12, 2010, 9:30:55 AM10/12/10
to dotnetde...@googlegroups.com
---------------------------------------------------

You are using Word in your application and ASPNET doesn't have rights
to run Word. Which is a good thing. You have fees to be paid to M$
to use Word in a server application. There is also the security
aspects of having Word run macros on your server. Talk about a
nightmare for IT Admin.


--
Stephen Russell

Sr. Production Systems Programmer
CIMSgts

901.246-0159 cell

stapes

unread,
Oct 12, 2010, 9:34:21 AM10/12/10
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
You don't recommend running word then? What are the alternatives?
I regularly use Excel and Outlook from web applications too.

On 12 Oct, 14:30, Stephen Russell <srussell...@gmail.com> wrote:
> On Tue, Oct 12, 2010 at 8:24 AM, stapes <steve.sta...@gmail.com> wrote:
> > Hi
>
> > I have built a website that writes into a Word Document template. It
> > works fine on my development machine, but when I move it to the live
> > server, it crashes with the following error:
>
> > Retrieving the COM class factory for component with CLSID
> > {000209FF-0000-0000-C000-000000000046} failed due to the following
> > error: 80070005.
>
> > My aspx.cs page has the following:
> > using Microsoft.Office;
>
> > In the /Bin folder is the dll file office.dll and interop.word.dll
>
> > In the add reference (using Visual Studio 2005) there is Microsoft
> > Office 11.0 Object Library and Microsoft Office 12.0 Object Library
> > and Microsoft Word 11.0 Object library.
>
> > I found a webpage that accurately describes my problem:http://
> >www.computerperformance.co.uk/Logon/code/code_80070005.htm#Solution_t...
>
> > I don't understand the answer.
>
> ---------------------------------------------------
>
> You are using Word in your application and ASPNET doesn't have rights
> to run Word.  Which is a good thing.  You have fees to be paid to M$
> to use Word in a server application.  There is also the security
> aspects of having Word run macros on your server.  Talk about a
> nightmare for IT Admin.
>
> --
> Stephen Russell
>
> Sr. Production Systems Programmer
> CIMSgts
>
> 901.246-0159 cell- Hide quoted text -
>
> - Show quoted text -

stapes

unread,
Oct 13, 2010, 6:49:55 AM10/13/10
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
OK. Today I learned about impersonation. Not Mike Yarwood. Added this
line to web.config:

<identity impersonate="true" userName="blah/blahblah"
password="blahblah"/>

Moved past the error I had yesterday, and got a new one. That's
progress!

Here is todays error:
Unable to cast COM object of type 'Word.ApplicationClass' to interface
type 'Word._Application'. This operation failed because the
QueryInterface call on the COM component for the interface with IID
'{00020970-0000-0000-C000-000000000046}' failed due to the following
error: Library not registered. (Exception from HRESULT: 0x8002801D
(TYPE_E_LIBNOTREGISTERED)).

I don't see why we shouldn't use these MS applications. They are there
to be used, and integrate well with the other products. The only
annoying thing is wasting 2 or 3 days because Microsoft are so worried
someone might use a product without paying for it.

Anyway - any ideas on this new error?
> > - Show quoted text -- Hide quoted text -

Jamie Fraser

unread,
Oct 13, 2010, 6:52:48 AM10/13/10
to dotnetde...@googlegroups.com
Are you sure word has been installed correctly on your Server?

stapes

unread,
Oct 13, 2010, 7:08:01 AM10/13/10
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Ah. I finally cracked it.

The solution is a little complicated. I got the gen here:
http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/08f13e9d-895c-4102-b6d9-e327af8cf8c0

"First off copy the CLSID from the error window that appears in
VB.NET. Access the registry via Start, Run, Cmd, RegEdt32, enter. Once
the registry editor loads up, do a search (ctrl F3) on that specific
CLSID (I didn't include the braces, but it shouldn't matter). The
registry should find a key located under the HKEY_CLASSES_ROOT ->
CLSID subkey. Expand this key and you should see 3 nodes:
ProxyStubCLSID,ProxyStubCLSID32 and the important one - TypeLib.
Essentially what is happening is that when you make the COM call to a
specific Office assembly. The assembly opens up the registry and finds
this key which gives it the CLSID of the TypeLib it must call in order
to initiate a call to the COM.

Under the TypeLib key copy the (Default) Entry (It should be another
long CSLID key). Now the easiest way to find this new key entry
relating to the CLSID, is to go back up to the root key,
HKEY_CLASSES_ROOT and look for the TypeLib subkey. I did this by
simply pushing "T" on the keyboard till I got to the all the "T's" on
the level below the HKEY root. Once you find this key, highlight the
key and do a search (Ctrl F3) from this key for the TypeLib CLSID that
you copied earlier. Once you find it, expand it and see if there are
multiple versions of the typelib i.e. 8.3, 8.4, 8.5. You want to
eliminate the the later versions that are pointing to non-existant
TypeLib's."

I found here 8.3 and 8.4. Gingerly, I deleted the key 8.4, and it
worked.

Jamie Fraser

unread,
Oct 13, 2010, 9:47:45 AM10/13/10
to dotnetde...@googlegroups.com
Glad you got it sorted. Just be very aware of the concurrency issues when using something like Word on a server. If more than one user accesses it at a time, you can end up in all sorts of bother.
Reply all
Reply to author
Forward
0 new messages