"System.ComponentModel.Win32Exception: Access is denied" error -- unsuccessfully tried several things

Hi,

I am trying to create a server-side Excel log sheet for a report that I am generating using C# .Net. I developed the report using Windows XP Pro, and after giving permission to ASPNET for Excel in the DComConfig, I was able to generate the Excel log file. However, when I uploaded the code to the server (which is a Windows 2000 Server OS), I was unable to run the report. I am getting "System.ComponentModel.Win32Exception: Access is denied" error. I have made sure that the error is thrown when I try to create the Excel application (XLApp = new Excel.Application();). I am listing the things that I have already tried below. Could you suggest any other things that I can try to give Excel access to the stupid .Net?

List of things already tried on the server:
1. Start --> Run dcomcnfg, included both ASPNET and IUSER_<NAME> user account for Microsoft Excel Application
2. Start --> Programs --> Microsoft Excel (Right-click --> Properties --> Security), included both ASPNET and IUSER_<NAME> user account, and gave them "Full Control"
3. In " Computer Management", added ASPNET and IUSER_<NAME> account to the Administrators Group
4. In Control Panel  --> Administrative Tools --> MS .Net Framework 1.1 Config, tried to set the "Runtime Security Policy" to minimum security for all categories

I've been trying to figure out a solution for two days now, and any help will be greatly appreciated. Thanks in advance!

rrjammy.

0
rrjammy
8/5/2005 6:54:15 PM
asp.net.integration 1945 articles. 0 followers. Follow

2 Replies
1635 Views

Similar Articles

[PageSpeed] 44

My first port of call for anything like this is the sysinternals site. Visit their site and grab loads of useful tools, RegMon, FileMon, Token Viewer and Process Explorer. With those tools you can usually get to the bottom of most security issues. Having said all that the web seems full of similar requests so I'm not sure it's do-able, in fact one poster even states it's designed not to run on the Server...I find that hard to believe. 

So my advice is try sysinternals, try BRIEFLY adding "everyone" to both settings in DCOM, launch and run or whatever they're called. RegMon is good if its an security problem with the registry since COM makes heavy use of that, FileMon is good if its a...file permission problem.
-1
pkr
8/17/2005 8:08:08 PM
Thanks pkr... I tried to add "Everyone" to the Excel DCOM, but it didn't work either. I found that VB allows Windows 2000 to open/save excel sheets, and I wrote two public functions in to do the same. I added the dll to my references, and that seems to solve the problem. Was able to solve the problem after more than 2 weeks' research. phew...

rrjammy.
0
rrjammy
8/18/2005 11:36:48 PM
Reply:

Similar Artilces:

Getting a "System.ComponentModel.Win32Expcetion: Access is denied" error in a web service
I've written a web service in ASP.NET 1.1 which runs on a Windows 2000 Server.  I have written it so that if an error occurs, it is supposed to write something into the event log.  It uses the standard "Application" for the event source.  The web service is currently accessed by an ASP.NET 1.10 web application on a different server.  We want to migrate the ASP.NET 1.1 application to a Windows 2003 server, but have it still run the ASP.NET 1.1 web service on the Windows 2000 Server.  After installing the ASP.NET 1.1 web app on the Windows 2003 Server and...

Error found "Access to the path "C:\Program Files\Microsoft Visual Studio .NET\Crystal Reports\Viewers" is denied. "
Hi guys! i'm trying to solve the error "Err Msg: "Object reference not set to an instance of an object" in ASP.NET app" but when i followed the instructions in the http://community.crystaldecisions.com/library/kbase/articles/c2011144.asp link, this error appeared ""Access to the path "C:\Program Files\Microsoft Visual Studio .NET\Crystal Reports\Viewers" is denied. " What's going on? i already went to the iis to add new virtual directory (CrystalReportWebFormViewer) but different error appeared when i compile and browse my application. pls help ...

error "System.ComponentModel.Win32Exception: The system cannot find the file specified"
hi all; iam tring to open word doc using System.Diagnostics.Process when i use it on local serevr and open file which is place on netwrok drive it works fi9 but when i host the side on IIS  and then run it so i get this msg    System.ComponentModel.Win32Exception: The system cannot find the file specified   [Win32Exception (0x80004005): The system cannot find the file specified]   System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo) +976   System.Diagnostics.Process.Start() +127   System.Diagnostics.Process.Sta...

How to automatically send denied users to "access denied" page, instead of a login prompt only then to be sent to "access denied" page
Hello: My security works fine except for one small annoyance.  This is an intranet site only and are using Windows (AD) authentication with Anonymous turned off.  The 'good' users get right in, with no prompts.  This is good.  However, the 'bad' (denied) users get a prompt to enter their credentials only to be denied.  I would like to eliminate the need for them to even try and enter credentials and send them directly to an "access denied" page (no prompts).  It only wastes their time and aggrevates them. Thoughts? Tha...

"access to path"...."is denied"
I have a program that opens a csv file and copies all records to a database.  its working fine in development system but when i deploy this to the live system and if i try to copy a csv file on my machine i am getting an error "access to path"..<tempfile.txt> .."is denied.  I am creating a temporary file on the live server and then changing data and then copying records from the temp file to the live databaseThe problem is that the program cannot access the temp file.  Is there a way to change security access rights of the temp file programmatically so tha...

"An error occurred saving the project file"PortalVBVS.vbproj". Access is denied."
"An error occurred saving the project file"PortalVBVS.vbproj". Access is denied." I have been getting this error msg all the time, anytime I update one of the files. Has anybody seen this error besides me. It been so frusrating I built a complete new system from scratch, and I'm still recieve this msg. I believe that it may be related to one of MS service packs, but It has made my portal useless. Any help would be greatly appreciated, thanks. OS 2000pro with VS2002 aghPeter Nagy Obvious question: do you have write permissions on the Folder? Are any files Read Onl...

"Access to report file denied" error trying to gnerate a PDF
I am getting the following error when trying to generate a PDF using Crystal Reports from a web application: Exception Details: System.Runtime.InteropServices.COMException: Error in File C:\WINDOWS\TEMP\...filename.rpt: Access to report file denied. Another program may be using it.  I everything I have researched points to following the advice: http://blogs.aspadvice.com/rjdudley/archive/2005/03/14/3058.aspx I followed the instructions but am still getting the “access to report file denied” error.  The web application is using...

"Access is denied" error occured when i try to import a wsdl from url
When i try to import the wsdl from url "Access is denied" error occured. REM set IMPORTER="C:\Program Files\Embarcadero\RAD Studio\9.0\bin\wsdlimp.exe" set IMPORTER="C:\Program Files (x86)\Embarcadero\Studio\16.0\bin\wsdlimp.exe" %IMPORTER% https://saglikt.sgk.gov.tr/medula/optik/OptikSaglikTesisiReceteIslemleriWS?wsdl When i run the batch file: D:\>"C:\Program Files (x86)\Embarcadero\Studio\16.0\bin\wsdlimp.exe" https://saglikt.sgk.gov.tr/medula/optik/OptikSaglikTesisiReceteIslemleriWS?wsdl Embarcadero WSDLIMP Version 2.41 - $Rev: 76228...

"Access Is Denied" Error is Thrown When Trying To Create A New Directory
I have a requirement to search for the existence of a directory (a specifice Company Name) that is beneath the application root. (C:\inetpub\wwwroot\MyWebApp\Documents\"CompanyName") and create it if it does not already exist. Where "CompanyName is the value held in the session variable, Session("curUser.nFacilityUid")I'm using the following code to check for the existence (and creation, if necessary) of a directory, but an execption is thrown each time I attempt to create a directory. The error message states "Access to the path "c:inetpubwwwrootmywebappdocumen...

"Access is denied" error occured when i try to import a wsdl from url #3
When i try to import the wsdl from url "Access is denied" error occured. REM set IMPORTER="C:\Program Files\Embarcadero\RAD Studio\9.0\bin\wsdlimp.exe" set IMPORTER="C:\Program Files (x86)\Embarcadero\Studio\16.0\bin\wsdlimp.exe" %IMPORTER% https://saglikt.sgk.gov.tr/medula/optik/OptikSaglikTesisiReceteIslemleriWS?wsdl When i run the batch file: D:\>"C:\Program Files (x86)\Embarcadero\Studio\16.0\bin\wsdlimp.exe" https://saglikt.sgk.gov.tr/medula/optik/OptikSaglikTesisiReceteIslemleriWS?wsdl Embarcadero WSDLIMP Version 2.41 - $Rev: 76228...

"Access is denied" error occured when i try to import a wsdl from url #2
When i try to import the wsdl from url "Access is denied" error occured. REM set IMPORTER="C:\Program Files\Embarcadero\RAD Studio\9.0\bin\wsdlimp.exe" set IMPORTER="C:\Program Files (x86)\Embarcadero\Studio\16.0\bin\wsdlimp.exe" %IMPORTER% https://saglikt.sgk.gov.tr/medula/optik/OptikSaglikTesisiReceteIslemleriWS?wsdl When i run the batch file: D:\>"C:\Program Files (x86)\Embarcadero\Studio\16.0\bin\wsdlimp.exe" https://saglikt.sgk.gov.tr/medula/optik/OptikSaglikTesisiReceteIslemleriWS?wsdl Embarcadero WSDLIMP Version 2.41 - $Rev: 76228...

"Access database" and "Login error"
Hey guys,I'm trying to get an Access database to be the location of the username/password combinations. I've done it is as far as I can tell, but I'm now stuck with the following error.These are some of things I have doneSet up the database in ODBC under the name "OdbcServices"Put the database in the "App_data" folder in the website directoryThanks for any help that you guys can give about the error.The Naked Programmer------------------------------------------ Configuration Error Description: An error occurred during the proc...

"Access is denied." Server Error occurs when I try to upload anykind of files to the server.
I don't have any problems with another test server that i have setup but this server which has a default IIS setup gives me trouble. Please help. 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 (ty...

"SQL Server does not exist or access denied" error when trying to connect from a Windows Service
Hi! I understand that this topic is one of the most discussed topics ever. However i could not find the relevant information after going through (almost) all the posts so far. Hence this post. I am getting the 'SQL Server does not exist or access denied' error when I am trying to access SQL Server from a WINDOWS SERVICE. SQL Server and the Windows service are running on two different machines. (When they are on the same machine, it works). All the solutions I found so far are related to web apps. What should I do in the case of a windows service? My connection string uses SQL server au...

BUG: Searching for things in "quotes" produces "Critical Error"
To Reproduce: in DNN 3.*+ Search for "anything here" or any combination like that. It seems any non URL compliant character (anythign that will be turned into %hex) will cause the error. expected results: In most search engines a search for "something here" will match the exact phraise whereas: something here will match each word individually....