Solved

Access Denied problem

Posted on 2003-11-02
4
1,211 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Is Your DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

Question has a verified solution.

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

Suggested Solutions

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

710 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