Solved

Access Denied problem

Posted on 2003-11-02
4
1,208 Views
Last Modified: 2013-11-25
i have found this website that teaches hw to Automate Microsoft Excel from Visual Basic .NET

http://support.microsoft.com/default.aspx?scid=kb;en-us;301982

I cannot find Microsoft Excel Object Library in the COM tab instead the nearest i can get is Microsoft Excel 8.0 Object Library. After i v tried adding this Imports Microsoft.Office.Interop but gave error as there is no such namespace. I am using a web based application instead of windows application.

All these difference i think are no big deal but when i tried running the code, it gave access denied.
below is the error

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.

The ASP.NET process is not authorized to access the requested resource. For security reasons the default ASP.NET process identity is '{machinename}\ASPNET', which has limited privileges. Consider granting access rights to the resource to the ASP.NET process identity.

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 "{machinename}\ASPNET" user. Highlight the ASP.NET account, and check the Write box in the Allow column.

Source Error:

Line 31:             Dim oExcel As Excel.Application = New Excel.Application()

Can anyone tell me which file to give the access rights.

Thanks
0
Comment
Question by:adomsg
  • 2
  • 2
4 Comments
 
LVL 2

Author Comment

by:adomsg
ID: 9667985
i am actually using another code instead of the code listed in the page.
i use Dim oExcel As Excel.Application = New Excel.Application() instead of Dim oExcel As Excel.Application = CreateObject("Excel.Application") to create the excel. If i use the code listed on the page i get the error below:

Cannot create ActiveX component.
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.Exception: Cannot create ActiveX component.

Source Error:

Line 33:             Dim oExcel As Excel.Application = CreateObject("Excel.Application")
 
Thanks alot in advance.
0
 
LVL 18

Expert Comment

by:testn
ID: 9668620
0
 
LVL 18

Accepted Solution

by:
testn earned 50 total points
ID: 9668623
0
 
LVL 2

Author Comment

by:adomsg
ID: 9675624
give me 1 to 2 days to try out, once done will give u the points. But from what i see, sound like it is difficult to implement the excel in server side. V u tried putting things into excel using VB.NET, can give some advice.

Thanks.
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question