Windows task scheduler does not produce any output when setting tasks with xlswrite

12 次查看(过去 30 天)
I struggled a lot with this. We have our in-house reports being generated and uploaded into a cloud shared drive. For the last couple of weeks the scheduled tasks got stuck when trying to write the output to Excel files. Same things applies when importing COM Objects using actxserver.
Solution: If you schedule a task in Windows (in our case Windows Server 2016 in a VM), and there is any xls write function or COM object, save your scheduled task in your processes with the following options under the General tab
  • Run only when user is logged on
  • Run with the highest privileges
The first option is quite inconvinient because you will have to be logged into the machine, it seems Microsoft doesn't allow scheduled tasks to be run when you are not logged. In this case it will simply not create any file at all.
For the second one, if the destination of the file is a network drive where your account has not high privileges, you will have to grant the access by imposing admin rights through these option.
Anyway, I fought with this issue for a couple of hours.
Hopefully someone finds it useful.
-V

回答(1 个)

Victor Villar
Victor Villar 2019-5-24
Answer in the description

类别

Help CenterFile Exchange 中查找有关 Use COM Objects in MATLAB 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by