Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Permissions Error

Status
Not open for further replies.

JustBarno

Programmer
Jun 21, 2004
46
US
Any Ideas?

Server Error in '/BrokerAdmin' Application.
--------------------------------------------------------------------------------

Access is denied.
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: Access is denied.

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 write 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 27: Dim xlWs As Excel.Worksheet
Line 28:
Line 29: xlApp = New Excel.Application
Line 30:
Line 31: With xlApp


Source File: C:\Inetpub\ Line: 29
 
First, right-click the file in Explorer, then choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group and lastly, highlight the ASP.NET account, and check the boxes for the desired access. ;-)

Seriously, though. You should just need to set the file permissions on the .xls file (the "Explorer" they're talking about is just Windows Explorer, you just need to navigate to the file and right-click it). When asked for the name of the user to add to the permissions group, type ASPNET, then you should see: MachineName/ASPNET in the users group. From there, you can grant the appropriate permissions (give as few as necessary).
 
Thanks, the error is happening on the following line,

xlApp = New Excel.Application

It has nothing to do with the .xls file, because it hasn't even been referenced yet... I checked permissions on the excel.exe in my office folder (IIS is in my local machine at this stage of the project), and ASP.net shows full permissions on that file.

Thanks,

-Justin
 
I added ASPNET as a local administrator and it fixed the problem... But this is obviously not an acceptable solution. Does anybody know which folder or file I can assign access?

I've tried the excel.exe file in the microsoft office folder, that's definately not it.

Thanks
 
found the answer

execute the dcomcnfg command from Run menue of your web server , or goto component services from administrative tools. select Component services >> Computers >> My Computer >> DCom Config. Search for Microsoft Excel Application. Right Click and goto properties. Select the Security Tab. Assign appropriate Launch and Access rights to ASPNET user of your machine.
 
How can I add the ASPNET user in my local web server? I think this is the solution to my problem because im experiencing the same problem mentioned above.

I tried the the answer posted above but i can't see DCom Config. Is anything i need to add or do?

Thanks!!!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top