Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

.NET MS Interop Word - COM Class Factory Error

Posted on 2014-03-24
5
Medium Priority
?
5,553 Views
Last Modified: 2014-03-29
I am developing a .NET 2012 application and using Microsoft.Interop.Word.  When my code gets to the sample code below it breaks in the Initialize method:

public class eobPrintBatch
{
    private Microsoft.Office.Interop.Word.Application wApp;

    private void Initialize()
    {
        wApp = new Microsoft.Office.Interop.Word.Application();  //Breaks here
    }
}

Open in new window


The error I am receiving is:

{"Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80080005."}
    [System.Runtime.InteropServices.COMException]: {"Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80080005."}
    Data: {System.Collections.ListDictionaryInternal}
    HelpLink: null
    InnerException: null
    Message: "Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80080005."
    Source: "PrintApp"
    StackTrace: "   at Print.PrintBatch.Initialize() in c:\\Apps\\PrintApp2012\\PrintBatch.cs:line 277\r\n   at PrintApp.PrintBatch.DoMonitor() in c:\\Apps\\PrintApp2012\\PrintBatch.cs:line 86"
    TargetSite: {Void Initialize()}

Open in new window


Any ideas?
0
Comment
Question by:CipherIS
  • 4
5 Comments
 
LVL 20

Expert Comment

by:Daniel Van Der Werken
ID: 39951007
Are you using the Microsoft Primary Interop Assemblies?

Basic info on PIA's:
http://msdn.microsoft.com/en-us/library/aax7sdch(v=vs.110).aspx

More information on Office PIA's:
http://msdn.microsoft.com/en-us/library/15s06t57.aspx

My best guess on this is that the .NET application is trying to load the appropriate Office COM object and unable to find it. You need to make sure you have the correct PIA's installed and properly "configured" to work with the correct version of Office on that system.
0
 
LVL 1

Author Comment

by:CipherIS
ID: 39951120
I removed the Interop and re-added it.  Now I'm receiving

{"Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE))."}
    [System.Runtime.InteropServices.COMException]: {"Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE))."}
    Data: {System.Collections.ListDictionaryInternal}
    HelpLink: null
    HResult: -2146959355
    InnerException: null
    Message: "Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE))."
    Source: "mscorlib"

Open in new window

0
 
LVL 1

Author Comment

by:CipherIS
ID: 39951126
Now its back to its original error:

{"Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80080005."}
    [System.Runtime.InteropServices.COMException]: {"Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80080005."}
    Data: {System.Collections.ListDictionaryInternal}
    HelpLink: null
    InnerException: null
    Message: "Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80080005."
0
 
LVL 1

Accepted Solution

by:
CipherIS earned 0 total points
ID: 39951403
I figured out the issue.  Office was corrupted.  I reinstalled Office and it resolved the issue.

Thank You
0
 
LVL 1

Author Closing Comment

by:CipherIS
ID: 39963531
Had to reinstall office.
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
This video walks the viewer through the process of creating an MLA formatted document, as well as a bibliography with citations.
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
Suggested Courses

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question