Upgraded to Office 2010, now ApplicationClass is error RRS feed

  • Question

  • This code worked before i changed from Office 2007 to Office 2010, now it crashes.  Please help!

    Part that seems to be the problem is the line where wordApplication.Visible = false:


    wordApplication = new
    wordApplication.Visible = false ;
    // Create a new document based on
    Object template = Type .Missing;
    Object newTemplate = Type .Missing;
    Object documentType = Type .Missing;
    Object visible = Type .Missing;

     wordDocument = wordApplication.Documents.Add(ref template, ref newTemplate, ref documentType, ref visible);

    threw this exception:

    "Unable to cast COM object of type 'Microsoft.Office.Interop.Word.ApplicationClass' to interface type 'Microsoft.Office.Interop.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: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE))."


    I think I read somewhere Cindy Meister's advice that:

    (You should also not use ApplicationClass - just Application.)


    but I don't know exactly how to make that work for me.  What do I do to fix this?


    Frederick Von Stubenstein
    Friday, January 7, 2011 9:35 PM


  • I fixed it by using regedit to erase all the junk Microsoft left from prior versions of Office that it didn't uninstall, then doing a repair on the new install of Office 2010

    Monday, January 10, 2011 1:29 PM

All replies