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

Michael Böckling picture Michael Böckling · Nov 20, 2010 · Viewed 17.3k times · Source

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 own user, and I had to change DCOM security settings ("launch as interactive user") to make it work.

The problem is, when I log off (via RDP), it stops working. I log on, it works again.

Has anyone had the same problem?

Answer

Michael Böckling picture Michael Böckling · Nov 22, 2010

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