none
System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. RRS feed

  • Question

  • Excel was upgraded from version 2010 to 2016.  Server is windows server 2012.

    I want to export from asp.net webpage on webserver to excel file.

    Now when I get excel object from asp.net webpage I get error message

    System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).

    any suggestions?

    thanks


    Fred

    Thursday, January 11, 2018 8:24 AM

All replies

  • Hello fred_m,
    According to  Considerations for server-side Automation of Office
    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.

    If you want to do automation of Office on server-side, we would suggest you use OpenXML SDK. Please try to refer to below links for more help.

    Welcome to the Open XML SDK 2.5 for Office
    Getting started with the Open XML SDK 2.5 for Office

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, January 12, 2018 2:25 AM
  • thanks for openxml sdk links, I might do openxml in the future,
    but what do I do now with this app?
    It worked fine before upgrade to Excel 2016.


    Fred

    Friday, January 12, 2018 8:15 AM
  • Hello fred_m,

    It may be caused by updating office from 2010 to 2016. Please try to repair or reinstall office.

    Besides, you could also try to refer to below threads which got the same issue as you.

    #“Retrieving the COM class factory for component… error: 80070005 Access is denied.” (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

    https://stackoverflow.com/questions/17785063/retrieving-the-com-class-factory-for-component-error-80070005-access-is-de

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, January 17, 2018 10:10 AM