Excel COM automation via interactive user stops working when user logs off

后端 未结 5 747
谎友^
谎友^ 2020-12-14 21:44

I have developed a server app that uses Excel 2007 COM automation to convert some xls files. It is started as a service on a Windows Datacenter instance, running under its o

5条回答
  •  萌比男神i
    2020-12-14 22:22

    Ok, so I couldn't get Excel to operate without an interactive user, no amount of DCOMCNFG trickery would do. So I simply configured autologin for the user the service is running under (see http://support.microsoft.com/kb/315231 for instructions).

    This has the effect that on server bootup, that user will login as an interactive console session. Unlike RDP sessions, this is permanent and makes Excel happy.

    Other hints for the poors souls who have to do something similar:

    • create the folder C:\Windows\System32[or SysWOW64]\config\systemprofile\Desktop
    • make sure a default printer is configured for the user the service runs under
    • change DCOMCNFG settings (mmc -32, add "component services") of Excel to run using the interactive account
    • change global DCOM defaults to allow local access, local launch and local activation for the user the service runs under

提交回复
热议问题