Question posted 2012 · +4 upvotes
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:xxxxabc.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
- Create folder in C:WindowsSysWOW64configsystemprofileDesktop. Please refer:this
- Grant rights of “myservice” in Component Services. Please refer:this
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.
Accepted answer +11 upvotes
Problem solved!!!!!!!!!! My Excel is 2010 , should create “Desktop” folder in C:WindowsSystem32configsystemprofile
Top excel Q&A (6)
- Shortcut to Apply a Formula to an Entire Column in Excel +335 (2011)
- How should I escape commas and speech marks in CSV files so they work in Excel? +136 (2012)
- Convert xlsx to csv in linux command line +96 (2012)
- How to create a link inside a cell using EPPlus +50 (2011)
- IF statement: how to leave cell blank if condition is false ("" does not work) +44 (2013)
- T-SQL: Export to new Excel file +44 (2012)
excel solutions on this site
.