Connecting Tech Pros Worldwide Help | Site Map

Excel System.UnauthorizedAccessException

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 21st, 2005, 06:36 PM
Jane
Guest
 
Posts: n/a
Default Excel System.UnauthorizedAccessException

I got the web application to open up the excel. It works fine on my
development box. But when i moved it to the production server, I cannot get
the Excel spreadsheet to open. I get System.UnauthorizedAccessException:
Access is denied.
I've granted full access for the excel file stored in the server, but still
can't access it. Please help!

  #2  
Old July 21st, 2005, 06:36 PM
Victor Hadianto
Guest
 
Posts: n/a
Default Re: Excel System.UnauthorizedAccessException

Have you tried granting the ASP user to have read access of the file? By
default this is ASPNET. Make sure you don't have 'deny' permission on that
file as well since it has higher precedence than the 'allow' permission.

--
Victor Hadianto
http://synop.com/Products/SauceReader/

"Jane" <Jane@discussions.microsoft.com> wrote in message
news:16A2C0E4-E47B-4899-A631-306EEDCCBBE0@microsoft.com...[color=blue]
>I got the web application to open up the excel. It works fine on my
> development box. But when i moved it to the production server, I cannot
> get
> the Excel spreadsheet to open. I get System.UnauthorizedAccessException:
> Access is denied.
> I've granted full access for the excel file stored in the server, but
> still
> can't access it. Please help![/color]


  #3  
Old July 21st, 2005, 06:36 PM
Cor Ligthert
Guest
 
Posts: n/a
Default Re: Excel System.UnauthorizedAccessException

Jane,

Is it opening the file on the clientside or the serverside?

Cor

"Jane" <Jane@discussions.microsoft.com>
..[color=blue]
>I got the web application to open up the excel. It works fine on my
> development box. But when i moved it to the production server, I cannot
> get
> the Excel spreadsheet to open. I get System.UnauthorizedAccessException:
> Access is denied.
> I've granted full access for the excel file stored in the server, but
> still
> can't access it. Please help![/color]


  #4  
Old July 21st, 2005, 06:37 PM
Jane
Guest
 
Posts: n/a
Default Re: Excel System.UnauthorizedAccessException

I have granted permission....
I'd like the excel to open on the client side, but seems like is not doing
it....

here's my code:

Excel.ApplicationClass excelObj = new Excel.ApplicationClass();
excelObj.Visible=true;
Excel.Workbook newbook =
excelObj.Workbooks.Add(Excel.XlWBATemplate.xlWBATW orksheet);
Excel.Workbook workBook =
excelObj.Workbooks.Open(strFileName,0,true,5,"","" ,true,Excel.XlPlatform.xlWindows,"",false,false,0, true,true,false);
Excel.Sheets sheets = workBook.Worksheets;
Excel.Worksheet dataSheet = (Excel.Worksheet)sheets.get_Item("Trade Ticket
Lookup");
Excel.Range range = dataSheet.get_Range("B2",Type.Missing);
dataSheet.Select(Type.Missing);
range.Cells.Value2=tradeID;

Excel.Worksheet tradesRealSheet = (Excel.Worksheet)sheets.get_Item("Trades
(Real)");
tradesRealSheet.Select(Type.Missing);

excelObj.Application.Quit();

I don't know what I'm doing wrong here, please help!
Thanks!

"Cor Ligthert" wrote:
[color=blue]
> Jane,
>
> Is it opening the file on the clientside or the serverside?
>
> Cor
>
> "Jane" <Jane@discussions.microsoft.com>
> ..[color=green]
> >I got the web application to open up the excel. It works fine on my
> > development box. But when i moved it to the production server, I cannot
> > get
> > the Excel spreadsheet to open. I get System.UnauthorizedAccessException:
> > Access is denied.
> > I've granted full access for the excel file stored in the server, but
> > still
> > can't access it. Please help![/color]
>
>
>[/color]
  #5  
Old July 21st, 2005, 06:37 PM
Cor Ligthert
Guest
 
Posts: n/a
Default Re: Excel System.UnauthorizedAccessException

Jane,

I saw that did not read it well, sorry, however maybe can this link help
you?

http://support.microsoft.com/default...;EN-US;Q257757

Cor


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.