Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a web project in .NET 4 that needs to access an 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. Please refer to:Excel 2007 automation on top of a Windows Server 2008 x64
  2. Grant rights of "myservice" in Component Services. Please refer to:COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005.

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

Please tell me how to fix this access problem. I assume that's permission problem of IIS but I can't solve it.

share|improve this question
add comment

1 Answer

Just a thought but its possible you are actually running into 32-bit versus 64-bit issues. Is the version of Excel (or Excel tools) that you have loaded on the server 32-bit? If so your application may be running in 64-bit mode or vice versa which is causing the server to try and load the 64-bit tools when they don't actually exist.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.