Excel无法访问IIS7和Windows Server 2008 R2(64位)中的文件。

4
我可以帮助您进行翻译。以下是您需要翻译的内容:

我有一个Web项目(.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.

在IIS7中,我使用“myservice”组管理员的身份来使用DefaultAppPool。
在IIS下的我的网站的身份验证页面中,启用了匿名身份验证并将其设置为“应用程序池标识”,同时禁用了ASP.NET模拟。
在搜索了几个小时后,我发现以下解决方案,但是它们都不起作用:
1. 在C:\Windows\SysWOW64\config\systemprofile\Desktop中创建文件夹。请参考:这里。 2. 在组件服务中授予“myservice”的权限。请参考:这里
有一件奇怪的事情,IIS_IUSRS组中没有任何内容。这正常吗?我记得至少有两个用户(DefaultAppPool和Classic .NET AppPool)。
我认为这是IIS的权限问题,但我无法解决它。

指定的目录是否存在?管理员组是否对该目录具有读取、写入、创建等权限? - sarnold
你没有提到已安装的Excel的版本和位数。 - Amit Naidu
1个回答

11

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


谢谢。我在使用SharePoint 2010 WebPart自动化Excel服务器端时遇到了完全相同的问题。在经过长时间的挣扎后,这个解决方法帮助了我,+1。 - Andez

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接