Excel Automation Windows Service

断了今生、忘了曾经 提交于 2019-12-02 01:25:00

Maybe I'm a bit late, but here I go anyway:

I had a similar issue and solved it by creating a Desktop folder in C:\Windows\SysWOW64\config\systemprofile and C:\Windows\System32\config\systemprofile.

It seems that Excel is not able to run under a specific user when used in a Windows service. Therefore, it runs with the LocalSystem service account, and it requires a Desktop folder in order to interact with Excel interop.

I have no further explanation, but it worked for me and it didn't cause any other know issue. I searched quite a lot for a definitive answer, but everything I found described the solution without specifying a reason.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!