Word 2016 automation generates "error: 80080005 Server execution failed"

2

I have Office 2016 preview installed on a Windows 7 (Ultimate edition) developer machine along with VS 2010. I have the following simple C# WinForms application that attempts to create a Word document through automation:

using Word = Microsoft.Office.Interop.Word;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            Word.Application word = new Word.Application(); // <- Causes exception
            ...
        }
}

The application generates the following error:

Additional information: 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)).

Most search results for the error in question above involve cases where people are trying to run (earlier) versions of Office programs on actual servers.

Am I missing something?

PS: Office 2016 is itself a strange beast in that it has no entry in Add/Remove Programs, and its deployment tool only has options for selecting applications to exclude from downloading, and no option for repairing an existing installation.

c#
ms-word
ms-office
office-interop
asked on Stack Overflow Dec 2, 2015 by Sabuncu

1 Answer

2

I tried to mimic your system as much as possible, by creating a WinForms project and targeting .NET 4.0. I'm able to create a Word.Application object without any exception.
I'm pretty sure that you are getting the error due to a corrupt Windows Registry, likely corrupted by Office itself.

There are 3 more things you can do before giving up:

  1. Go here and follow the steps to clean up the Registry using scanreg /fix
  2. Uninstall every Office product, open the Registry and delete EVERY key related to Office, then install 2016 again (make sure to backup all your data first)
  3. Reinstall Windows.

I worked in an application support position where the application was very integrated with Excel and Word through add-ins, and I had to research and explain to the development team (another vendor) why this happened and how it can be solved in some cases.
Until I found step 1 above and the steps I told you in my first comment to your question, every single case was solved using step 3.

answered on Stack Overflow Dec 5, 2015 by Camilo Terevinto

User contributions licensed under CC BY-SA 3.0