When the Excel component is called in ASP. NET, if the Excel permission in DCOM is not configured, the Program Reports: access is denied.
There are two solutions:
First, set a node in Web. config.
<Identity impersonate = "true"/>
However, this method can only solve the problem of Excel access is denied on the local computer.
If it is a server, when a client accesses the page, the same problem still cannot solve the Excel permission problem.
Second, configure DCOM
If the program is placed on the server side, but the PC side needs to access the server's program, the first method still cannot be solved. This method can only be used.
1. Run dcomcnfg to open the component service and expand "component services"-> "computers"-> "my computer"-> "DCOM config"
2. Right-click Microsoft Excel application to open the Properties dialog box,
3. Select the "ID" label and then select the Interactive User
4. select the "Security" label. set "launch and activation permissions" to start and activate permissions and "Access Permissions" to custom permissions, and then set system, interactive, everyone, administrators, IUSR _ <machinename>, IWAM _ <machinename> are added to these accounts, and all permissions are granted to them.
4. Click OK and close the component service.