CipherIS
asked on
.NET MS Interop Word - COM Class Factory Error
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:
The error I am receiving is:
Any ideas?
public class eobPrintBatch
{
private Microsoft.Office.Interop.Word.Application wApp;
private void Initialize()
{
wApp = new Microsoft.Office.Interop.Word.Application(); //Breaks here
}
}
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()}
Any ideas?
ASKER
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"
ASKER
Now its back to its original error:
{"Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-0 0000000004 6} failed due to the following error: 80080005."}
[System.Runtime.InteropSer vices.COME xception]: {"Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-0 0000000004 6} failed due to the following error: 80080005."}
Data: {System.Collections.ListDi ctionaryIn ternal}
HelpLink: null
InnerException: null
Message: "Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-0 0000000004 6} failed due to the following error: 80080005."
{"Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-0
[System.Runtime.InteropSer
Data: {System.Collections.ListDi
HelpLink: null
InnerException: null
Message: "Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-0
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Had to reinstall office.
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.