Application throws an error when launched from task scheduler

前端 未结 3 1783
时光说笑
时光说笑 2021-01-25 21:17

I have a custom application which uses Microsoft.Office.Interop.Excel.Application to open and save excel file. I have a batch which fires the app with all the required parameter

相关标签:
3条回答
  • 2021-01-25 21:45

    I have found a solution here http://justgeeks.blogspot.co.uk/2012/10/troubleshooting-microsoft-excel-cannot.html

    the trick is you have to craete this folder:

    C:\Windows\SysWOW64\config\systemprofile\Desktop

    I must admit I do not quite understand why this folder is required for excel to open files when launched by task scheduler but it works.

    0 讨论(0)
  • 2021-01-25 22:07

    Actually I haven't tried the answer by @Maju but this Superuser question has a solution which worked for me: you have to config DCOM. I set the identity to run Excel to the identity which I'm using in the Task Scheduler.

    https://superuser.com/questions/579900/why-cant-excel-open-a-file-when-run-from-task-scheduler

    0 讨论(0)
  • 2021-01-25 22:07

    I added the following directory c:\windows\syswow64\config\systemprofile\desktop

    0 讨论(0)
提交回复
热议问题