无法使用网络路径中的服务帐户打开Excel [英] Unable to Open Excel using Service Account from Network Path

查看:90
本文介绍了无法使用网络路径中的服务帐户打开Excel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我的应用程序基本上打开一个excel并写入其中。如果我要提到驱动器位置,应用程序成功写入excel但是一旦我将其更改为网络路径,应用程序将无法按预期工作。当我放入日志时,我发现
表示excel文件没有打开。 


经过进一步调查后,我发现当我使用相同的服务登录IDE时帐户,应用程序按预期工作。


所以你认为这与服务器本身有关。我们已经在Windows 2012 Enterprise中托管了此应用程序,该应用程序存在于具有大量安全性的MPC(托管私有云)中。


请提供建议。如果您需要任何其他详细信息,请与我们联系。







Amit Sahoo

解决方案

您好
AmitSahoo,


看起来你正试图在服务器上运行代码来打开Excel。


通常MS Office在服务器上无法正常工作。


服务器端Office自动化的注意事项


其他事项检查您是否拥有打开Excel的适当权限。


Excel查找系统中的某些文件夹。 在systemprofile文件夹中似乎需要一个Desktop文件夹来通过Excel打开文件。很多时候,这解决了很多excel自动化问题。

  • 对于64位(x64),请创建此文件夹:C:\ Windows \ SysWOW64 \ config \systemprofile \Desktop。
  • 对于32位(x86),创建此文件夹:C:\ Windows \System32 \config \systemprofile \Desktop

有关详细信息,您可以也请访问以下链接。


从Windows服务打开excel文件时出现问题


使用Windows服务打开Excel文件


问候


Deepak


Hi All,

My application basically opens a excel and writes into it. If I will mention drive location the application successfully writes into the excel but once I will change it to a network path the application doesn't work as expected. When I put logs, I found that the excel file is not opening itself. 

After further investigation, I found that when I logged into my IDE using the same service account, the application works as expected.

So do you think this is something to do with the server itself. We have hosted this application in Windows 2012 Enterprise which is present in a MPC (Managed Private Cloud) having lots of security and all.

Please advise. Let me know if you need any other details.



Amit Sahoo

解决方案

Hi AmitSahoo,

it looks like you are trying to run code on server to open Excel.

generally MS Office doesn't work properly on server.

Considerations for server-side Automation of Office

other thing check that you have proper permission to open Excel.

Excel looks for certain folders in the system.  A Desktop folder seems to be necessary in the systemprofile folder to open file by Excel. A lot of times, this solves a lot of excel automation issues.
  • For 64-bit (x64), create this folder: C:\Windows\SysWOW64\config\systemprofile\Desktop.
  • For 32-bit (x86), create this folder: C:\Windows\System32\config\systemprofile\Desktop

For further information you can also visit links below.

Problem with opening excel files from a windows service

Using windows service to open an Excel file

Regards

Deepak


这篇关于无法使用网络路径中的服务帐户打开Excel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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