-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: laxman_b
Message 1 in Discussion

hi,      I have run the following code in windows application.it worked well and 
created a file on the disk    
Excel.Application ExO =new Excel.ApplicationClass(); 
Excel._Workbook ExWb = (Excel._Workbook)(ExO.Workbooks.Add("book1")); 
Excel._Worksheet ExWs = (Excel._Worksheet)ExWb.ActiveSheet; 
ExWs.Cells[1,1] = "lakshman"; 
ExWs.Cells[1,2] = "kumar"; 
ExWb.SaveCopyAs("d:\\lak.xls"); 
but when i use the same code in c# web application  
its throwing following error 
  Server Error in '/first' 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. 

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 163:           { Line 164:                      Line 165:                     
 Excel.Application ExO =new Excel.ApplicationClass(); Line 166:                  
Excel._Workbook ExWb = (Excel._Workbook)(ExO.Workbooks.Add("book1")); Line 167:        
         Excel._Worksheet ExWs = (Excel._Worksheet)ExWb.ActiveSheet; 
  
Can some one help me. 
-lakshman

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to