locked
Error in web applications with MS Word RRS feed

  • Question

  • User-354017594 posted

    Hi all,

    Has anyone encounter this error when a webapp tries to create a new document with a template?

    I've a webapp (VS2008, .net 3.5) deployed in a MS Windows server 2003 (with MS Office Word installed in it and gives this error below when I tried to populate data onto the template/word (Office 2003). I have no problem in doing it in my local machine (Windows XP).

    Prior to this error, I have solved an error code with 80070005 by following the steps posted in this blog. http://blog.crowe.co.nz/archive/2006/03/02/589.aspx

    I am wondering whether this is a webapp limitation because it tries to create a document in a desktop that initiates from server?

    Any solution, answer or  explanation to this problem is highly appreciated.

    Nick

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

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {00020906-0000-0000-C000-000000000046} failed due to the following error: 80080005.

    Source Error:

    Line 284:        //creating object of word and document
    Line 285:        Word.Application oWord = new Word.Application();
    Line 286:        Word.Document oWordDoc = new Word.Document();
    Line 287:
    

     

     

     

    Thursday, February 4, 2010 9:34 PM

All replies

  • User771898575 posted

    check the post
    http://social.msdn.microsoft.com/Forums/en-US/innovateonoffice/thread/b81a3c4e-62db-488b-af06-44421818ef91?prof=required


    Thursday, February 4, 2010 11:50 PM
  • User719155307 posted

    Hello,

    I encountered this thread and tried everything described in the address mentioned above http://blog.crowe.co.nz/archive/2006/03/02/589.aspx , but nothing seems to help. 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 tried to give tne Network Service user the launch and access rights explined above, but that does not help. Very nasty :( Any clues ?

    Best regards and thank you,
    Liubo

    Friday, February 5, 2010 6:22 AM
  • User-354017594 posted

    Do you have MS Office installed in the server? 

    Friday, February 5, 2010 10:10 PM
  • User-1199946673 posted

    Do you have MS Office installed in the server? 

     

    What you're basicly asking is this: Did you violate the license agreement?

    Any solution, answer or  explanation to this problem is highly appreciated.
     

    "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:15 PM
  • User719155307 posted

    Hey,

     

    Here is the solutions, finally it worked out :0

    Add to web.config file 

    identity impersonate="true"/>

    <

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

     

    Regards,

    Liubomir

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

    Here is the solutions, finally it worked out
     

    But still the fact remains that you shouldn't use Office.Interop in a web environment! Also, does your License agreement allow you to install Office on a web server?

    Thursday, April 29, 2010 7:50 AM
  • User719155307 posted

    Yup, i see, according to the MS recommendations. yes, we have office license and we use the application only in the internal network.

    Have a nice day!


    Thursday, April 29, 2010 8:31 AM