Excel无法使用iis7和windows Server 2008 R2(64位)访问文件

时间:2021-07-31 01:54:43

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

我有一个网络项目(。NET 4)需要访问Excel文件,但最终会出现以下错误消息:

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.

在IIS7中,我使用DefaultAppPool与在管理员组之下的标识“myservice”一起使用。

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.

在我的网站IIS下的认证页面,匿名认证被激活并设置为“应用程序池标识”和ASP。净模拟是禁用的。

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:this
  2. 创建文件夹C:\Windows\SysWOW64\config\ systemprofile \桌面。请参考:
  3. Grant rights of "myservice" in Component Services. Please refer:this
  4. 在组件服务中授予“myservice”的权限。请参考:

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).

奇怪的是,IIS_IUSRS组里什么都没有。是正常的吗?我至少记得两个用户(DefaultAppPool & Classic . net AppPool)。

I assume that is a permission problem of IIS, but I can not solve it.

我认为这是IIS的权限问题,但我无法解决。

1 个解决方案

#1


11  

Problem solved!!!!!!!!!! My Excel is 2010 , should create "Desktop" folder in C:\Windows\System32\config\systemprofile

问题解决! ! ! ! ! ! ! ! ! !我的Excel是2010,应该创建“桌面”文件夹C:\Windows\System32\config\ systemprofile

#1


11  

Problem solved!!!!!!!!!! My Excel is 2010 , should create "Desktop" folder in C:\Windows\System32\config\systemprofile

问题解决! ! ! ! ! ! ! ! ! !我的Excel是2010,应该创建“桌面”文件夹C:\Windows\System32\config\ systemprofile