I have a web project (.NET 4) that needs to access an Excel file, but it ends up with the following error message:
Error occurred 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 is there)
• The file is being used by another program. (It can not 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 is 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
One thing strange, there is nothing in the Group of IIS_IUSRS. Is that normal? I remember at least two users (DefaultAppPool & Classic .NET AppPool).
I assume that is a permission problem of IIS, but I can not solve it.
Problem solved!!!!!!!!!! My Excel is 2010 , should create "Desktop" folder in C:\Windows\System32\config\systemprofile
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With