1
I'm using Windows Task Scheduler to restart MS excel when it crashes, via an event trigger that runs a vbs script (https://stackoverflow.com/questions/18504067/how-to-automate-the-forced-closure-of-excel-followed-by-a-restart/18654283#18654283).
Both excel and my long-running macro, successfully re-start when the trigger event occurs. However, the problem i'm having is that excel starts in the background.
When I remote log into the machine (as Administrator) the excel gui is nowhere to be seen. Under task manager one can see that excel.exe is running (as is my macro, since report files continue to be written).
If I run the vbs script manually (ie double click, when logged in) then excel starts in the foreground.
I've set the task scheduler to run the task as administrator, and to run whether the user is logged in or not. Are there any other settings I should be aware of that relate to starting excel in the foreground from a scheduled task?
I'm using Windows Server 2008R2 and excel 2010.
Thanks, Yug
Added: To be clear the difference in behaviour seems to be whether the script is run by task manager or is run manually (my being remote logged in or not is irrelevant. When task manager runs the script, it starts excel as hidden).
On the off-chance, what happens if you right-click excel in task manager and maximize the window?
Does this full-screen the application? – DLMono – 2014-01-29T05:30:07.830
The Excel application is NOT visible under the applications tab in taskmanager, so nothing to right click there. However excel.exe can be seen under the processes tab. Right clicking the excel.exe process gives a few options, none of which appear to help. – Yugmorf – 2014-01-29T10:23:20.333
Man, I have exactly the same problem.. I also tried to force it to maximize, but it didn't work.. Have you already found a solution? I also added a question,but on SO: http://stackoverflow.com/questions/21879435/how-to-start-a-program-with-command-line-arguments-on-windows-cmd-and-force-it
– periback2 – 2014-03-18T12:12:51.807