Microsoft Excel无法访问文件“...”。有几个可能的原因。带有Microsoft Office 2010的Windows Server 2008 R2 [英] Microsoft Excel cannot access the file “…”. There are several possible reasons. Windows Server 2008 R2 with Microsoft Office 2010

查看:660
本文介绍了Microsoft Excel无法访问文件“...”。有几个可能的原因。带有Microsoft Office 2010的Windows Server 2008 R2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我在特定用户(服务帐户)下启动Excel应用程序时遇到问题。

I have a problem with starting the Excel Application under a particular user (service account).


我尝试安排这个C#脚本通过应用程序X(不是Windows任务计划程序。这个

I try to schedule this C# script through an application X (not Windows Task Scheduler. And this


应用程序将始终使用服务帐户在服务器上运行服务)。如果我在
中运行C#脚本

application will always use a service account to run services on the server). If I run the C# script in


命令提示符在同一个用户下运行。在应用程序X下,它使用完全相同的

command prompt under the same user, it runs. Under the application X, which uses the exact same


用户,要启动C#脚本,它无法打开Excel应用程序(没有足够的权限?)。

user, to initiate the C# script, it fails to open the Excel application (not sufficient permission?).


此脚本调用application.Workbooks.Open(< ExcelFileName>,0,false,Type.missing ....)。在这一行

This script calls application.Workbooks.Open(<ExcelFileName>,0,false,Type.missing....). At this line


代码,它给出以下错误:

of code, it gives the following error:


Microsoft Excel无法访问该文件" ..." ;.有几个可能的原因:

Microsoft Excel cannot access the file "...". 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.


我tr我在网上找到的所有方法如下:

I tried all the methods that I found online as follow:


  1. 创建目录"C:\ Windows \SysWOW64 \ config \systemprofile \Desktop"(对于64位Windows)或"C:\ Windows \ System32 \ config \systemprofile \Desktop"(对于32位Windows)
  2. 更改了Microsoft Excel应用程序的DCOM配置,以包含此用户进行本地/远程启动和访问
  3. 启用Excel应用程序中的所有宏并设置信任中心。
  4. 添加用户以完全控制包含Excel文件的所有文件夹。
  5. 在DCOM
    config,Microsoft Excel Application下,如果我修改Identity选项卡以检查"This User"并输入用户名/密码,让Excel始终在该用户下运行。应用程序运行完美。但是,其他用户无法自行运行excel应用程序
    ,并出现以下错误:"无法使用对象链接和嵌入"。如果我选​​中"使用启动用户",则Excel无法启动。日志或事件无任何错误检查。




然而,仍然是同样的错误。我认为这是允许的,但我不知道在哪里以及该怎么办才能使用。

Yet, still the same error. I think it's permission but I am not sure where and what to do for this to work.


现在,通常情况下,当我运行这个excel报告时,我可以双击该文件并自动运行,

Now, normally, when I run this excel report, I can double-click on the file and it'd automatically run,


将新参数保存到当前文件中并生成一个新的excel文件(日期附加到

save the new parameters into the current file and generate a new excel file (with date attached to the


文件名)。这意味着对原始文件进行了更改(保存)。

file name). That means there is a change (save) to the original file.


环境:Windows Server 2008 R2并运行Microsoft Excel 2010。

Environment: Windows Server 2008 R2 and running Microsoft Excel 2010.


我感谢您的帮助!

I appreciate all your help!

推荐答案

我想知道这是否与用户登录Excel有关。

I am wondering if this has anything to do with having the user log into Excel.

在上面的第5点中:在DCOM配置,Microsoft Excel应用程序下,如果我修改"身份"选项卡以检查"此用户"并输入用户名/密码以使Excel始终在该用户。然后应用程序运行完美。但是,其他
用户无法自行运行excel应用程序,并出现以下错误:"无法使用对象链接和嵌入"。如果我选​​中"使用启动"用户",然后Excel无法启动。日志或事件无任何错误检查。

In point #5 above: Under DCOM config, Microsoft Excel Application, if I modify the Identity tab to check on "This User" and enter the username/password to let Excel always run under that user. Then the application runs perfectly. However, other users can't run the excel application on their own with the following error: "Cannot use object linking and embedding". If I check "Use the launching user", then Excel can't be launched. No errors in the logs or events anywhere to check.

因为与启动用户一起运行建议用户运行Excel应用程序。但是,我认为没有任何地方可以将此用户的密码传递给Excel。但是r,这个Excel拥有Excel应用程序的所有权限
以及包含Excel文件的文件夹。

Because running with the launching user proposes an user to run the Excel application. However, I do not think there is any where that we can pass in the password for this user to Excel. However, this Excel has all the permissions to Excel application as well as the folders that have the Excel files.

请帮助!

谢谢!


这篇关于Microsoft Excel无法访问文件“...”。有几个可能的原因。带有Microsoft Office 2010的Windows Server 2008 R2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆