locked
MS Word error: Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005. RRS feed

  • Question

  • User719155307 posted

    Hello,

    I am using the Microsoft Office 2003 API to open a word document, make some find and Replace operations and then Save the result as another document. This happens successfully on the test Win 2003 server, but when I deploy the application to the production WIn2003 server it fails with the error:

    Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005.

    I encountered another thread in the forum and tried everything described in the following address http://blog.crowe.co.nz/archive/2006/03/02/589.aspx , but nothing seems to help.

    I tried to give tne Network Service user the launch and access rights explained there, but that does not help. Very nasty :( Any clues ?

    Best regards and thank you,
    Liubo

    Friday, February 5, 2010 6:26 AM

All replies

  • User-1199946673 posted

    "Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment."

    http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257757#kb2 

    Saturday, February 6, 2010 10:12 PM
  • User719155307 posted

    OK has_v, I agree, but fact is that it worked out using this solution:

    Add to web.config file 

    identity impersonate="true"/>

    <

     http://forums.asp.net/t/1309171.aspx

     

    Regards,

    Liubomir

     

    Thursday, April 29, 2010 7:47 AM
  • User-1199946673 posted

    OK has_v, I agree, but fact is that it worked out using this solution
     

    What do you mean with "worked out"? Are you sure the server will not become unstable if more users simultaniously use this functionality? I wouldn't count on that! A quote from somebody that tried running Excel the same way:

    I’ve just experienced the above. EXCEL.EXE insisted in being alive in task manager even after processing the data and being closed in code. Each call to process a spreadsheet opens an EXCEL.EXE process on the server. With such EXCEL.EXE processes don’t being closed as they should you get lots of those processes on memory which could overload the server.

    http://www.leniel.net/2009/07/creating-excel-spreadsheets-xls-xlsx-c.html

    Thursday, April 29, 2010 7:55 AM
  • User-949037948 posted

    Hello,

      You need to kill word process to prevent the MS Word Error. 

      System.Diagnostics.Process[] aProcWrd = System.Diagnostics.Process.GetProcessesByName("WINWORD");

       foreach (System.Diagnostics.Process oProc in aProcWrd)
       {
         oProc.Kill();
       }

    Sunday, December 26, 2010 8:39 PM