This blog is created based on my colleague experience.
He created an application to automate Excel process to read and write an Excel file. The application was able to run the process successfully if it was run manually. But, the application was failed to run if it was run from Task Scheduler. Even though he forced the application to run from the Task Scheduler, the application was still unable to run.
He found the solution from a thread in Microsoft forum. The solution is:
In Windows 2008 Server x64
Please make this folder.
C:\Windows\SysWOW64\config\systemprofile\Desktop
In Windows 2008 Server x86
Please make this folder.
C:\Windows\System32\config\systemprofile\Desktop
This operation took away office automation problems in my system.
A Desktop folder seems to be necessary in the systemprofile folder to open file by Excel.
This solution is a bit ridiculous, but may be the purpose of this folder is for a dummy or temporary folder of the Excel automation process. Somehow this solution solve the automation problem.
Cheers.
References: