locked
Excel Security Problem RRS feed

  • Question

  • User-1186452943 posted

    Hello i am using VS 2005 and XP  .

    i am try to export excel file using introp service

    it working  fine on my local machine

    but when i am try to run from remote machine it generate  error

    Server Error in '/excel' Application.

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

    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.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005.

    ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

    To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.

    Source Error:

    Line 7:  
    Line 8: Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Line 9: Dim oExcel As New Excel.Application()
    Line 10: Dim oBooks As Excel.Workbooks, oBook As Excel.Workbook
    Line 11: Dim oSheets As Excel.Sheets, oSheet As Excel.Worksheet

    Source File: D:\excel_export\Default.aspx.vb    Line: 9

    Stack Trace:

    [UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005.]
    _Default.Page_Load(Object sender, EventArgs e) in D:\excel_export\Default.aspx.vb:9
    System.Web.UI.Control.OnLoad(EventArgs e) +99
    System.Web.UI.Control.LoadRecursive() +47
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061


    Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
    <!-- [UnauthorizedAccessException]: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005. at _Default.Page_Load(Object sender, EventArgs e) in D:\excel_export\Default.aspx.vb:line 9 at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) [HttpUnhandledException]: Exception of type 'System.Web.HttpUnhandledException' was thrown. at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.default_aspx.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) --><!-- This error page might contain sensitive information because ASP.NET is configured to show verbose error messages using <customErrors mode="Off"/>. Consider using <customErrors mode="On"/> or <customErrors mode="RemoteOnly"/> in production environments.--> 

    Friday, June 27, 2008 2:16 AM

Answers

  • User214117797 posted

    First make sure the right version of Excel is installed on your server, then make sure you have the interop files on your web server as well, they should be in your BIN folder.
     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 27, 2008 2:26 AM

All replies

  • User214117797 posted

    First make sure the right version of Excel is installed on your server, then make sure you have the interop files on your web server as well, they should be in your BIN folder.
     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 27, 2008 2:26 AM
  • User-1186452943 posted

    It's Not Working in that way because by using web application you are not able to run application from remote machine.

    you can generate .CSV file and use it

    Saturday, September 20, 2008 7:36 AM