Working on Win 10:
Using code and instructions at Post
#6 I tried many methods to set up Task Scheduler to run with the argument "TaskScheduler" but nothing I tried worked. The task kept running with no visual feedback of the Command Line so I went back to creating a shortcut to test the format. The only way I could Get 'TaskScheduler' to appear in the CommandLine was to rename the WB including 'TaskScheduler' in the name.
Workbook Name - TaskSchedulerTest.xlsm
Shortcut target - "C:\Program Files\Microsoft Office\Office14\EXCEL.EXE" D:\TaskSchedulerTest.xls
Using those names the code made the right decisions as follows:
CommandLine when opening the workbook direct:-
"C:\Program Files\Microsoft Office\Office14\EXCEL.EXE" /dde
The workbook did not close
CommandLine when opening via shortcut:-
"C:\Program Files\Microsoft Office\Office14\EXCEL.EXE" D:\TaskSchedulerTest.xlsm
The workbook did close
It should be a doddle to do that within Task Scheduler and remove the shortcut - another day.
Without testing, I suspect finding the result of ActiveWookbook.Name within CommandLine should work.