I was trying to open an Excel file programmatically in my .NET web application. I used the code in one my previous posts. Unfortunately, I found myself struggling with this hair-pulling issue:
Microsoft Office Excel cannot access the file ‘c:\file.xlsx’. There are several possible reasons:
• The file name or path does not exist.
• The file is being used by another program.
• The workbook you are trying to save has the same name as a currently open workbook.
Solution
As it’s stated here, follow these 2 easy steps. Then you can go back to your normal life!
- Create directory
C:\Windows\SysWOW64\config\systemprofile\Desktop
(for 64 bit Windows) orC:\Windows\System32\config\systemprofile\Desktop
(for 32 bit Windows) - Set full control permissions on Desktop directory above (for example in Win7 > IIS 7 > DefaultAppPool: set permissions for user
IIS AppPool\DefaultAppPool
)
Worked like a charm!
Worked like a charm!
Thank you. Worked but did not have to set Pool permissions. Just gave access to IIS_IUSR and network service.
Thank you, it worked
it worked !! yippee!
Magic spell thanks a ton
yahoo..yahoo.yahooo…now i can finally go back to my normal life..God bless
nick post, worked for me!!! thanks
How Do i get this done for Windows 10 ?