0

When i run

private void Print_Click(object sender, EventArgs e)
{
    var application = new Microsoft.Office.Interop.Word.Application();
    var document = new Microsoft.Office.Interop.Word.Document();

    document = application.Documents.Add(Template: @"C:\Office\Word\Templates\AttNoteEN.dotm");

    application.Visible = true;
}

i get the below message. i have the reference in for the office interop but i still get this message.

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)).'

James Z
  • 12,209
  • 10
  • 24
  • 44
  • 1
    Use Task Manager, Processes tab and check the number of Winword.exe processes you see. – Hans Passant Feb 24 '20 at 16:42
  • cleared them down and still get the error – Matthew Rodwell Feb 24 '20 at 16:44
  • Did you search for your CO_E_SERVER_EXEC_FAILURE error? I just did. Your problem has to do with DCOM and security. See [this post](https://social.msdn.microsoft.com/Forums/sqlserver/en-US/84337401-ad10-4df9-baba-3ea354810087/how-to-resolve-error-0x80080005-coeserverexecfailure?forum=worddev) and [this one too](https://stackoverflow.com/questions/22062284/server-execution-failed-exception-from-hresult-0x80080005-co-e-server-exec-fa). The latter is for excel but it is the same problem. – Señor CMasMas Feb 24 '20 at 16:55

0 Answers0