【问题标题】:Excel cannot access the file with IIS7&Windows Server 2008 R2 (64bit)Excel 无法使用 IIS7&Windows Server 2008 R2 (64bit) 访问文件
【发布时间】:2012-06-21 02:38:19
【问题描述】:

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

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.

在 IIS7 中,我使用 DefaultAppPool 和管理员组下的身份“myservice”。

在我的网站在IIS下的身份验证页面中,启用了匿名身份验证并设置为“应用程序池身份”,并禁用了ASP.NET模拟。

在搜索了几个小时的解决方案后,我发现了以下但没有一个工作

  1. 在 C:\Windows\SysWOW64\config\systemprofile\Desktop 中创建文件夹。请参考:this
  2. 在组件服务中授予“myservice”的权利。请参考:this

奇怪的是,IIS_IUSRS 组中没有任何内容。这正常吗?我记得至少有两个用户(DefaultAppPool 和 Classic .NET AppPool)。

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

【问题讨论】:

  • 命名目录是否存在?管理员组是否对该目录具有读、写、创建等权限?
  • 你没有提到安装的Excel的版本和位数。

标签: excel iis-7 permissions windows-server-2008 identity


【解决方案1】:

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

【讨论】:

  • 谢谢。我在使用 SharePoint 2010 WebPart 自动化 Excel 服务器端时遇到了完全相同的问题。经过很多挫折后,这为我 +1 修复了。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-12-21
  • 1970-01-01
相关资源
最近更新 更多