Excel cannot access the file with IIS7&Windows Serer 2008 R2(64bit)

Posted by user838204 on Server Fault See other posts from Server Fault or by user838204
Published on 2012-06-21T02:35:57Z Indexed on 2012/06/21 3:18 UTC
Read the original article Hit count: 697

I have a web project(.Net4) that needs to access Excel file, but it ends up with the following error message:

Error occured during file generation.Microsoft Excel cannot access the file 'D:\xx\xx\abc.xls'. 
There are several possible reasons: 
• The file name or path does not exist. (Actually it's there)
• The file is being used by another program.(It cant happen) 
• The workbook you are trying to save has the same name as a currently open workbook.

In IIS7, I use DefaultAppPool with the Identity "myservice" who's under the Group of Administrators. In the Authentication Page of my website under IIS, Anonymous Authentication was enabled and set to "Application pool identity" and ASP.NET Impersonation was disabled.

After searching the solution for hours, I found the following but NONE of them work

  1. Create folder in C:\Windows\SysWOW64\config\systemprofile\Desktop. Plz refer:this
  2. Grant rights of "myservice" in Component Services. Plz refer:this

One thing strange, there is nothing in the Group of IIS_IUSRS. Is that normal? Cause I remember at least two users (DefaultAppPool & Classic .Net AppPool).

Plz tell me how to fix the access problem. I assume that's permission problem of IIS but I cant solve it.

Thank you.

© Server Fault or respective owner

Related posts about windows-server-2008

Related posts about iis7