title: Scheduling a macro enabled Excel sheet via Windows Scheduler
body: <p>I have a macro enabled Excel Sheet which is set to run certain code when it opens and then close itself when it is finished, the spreadsheet works perfectly and does it's code when opened and closes when finished.</p>
  <p>However I'm trying to schedule it to open itself every day via windows task scheduler but I'm having trouble.</p>
  <p>I've set up a basic task with the Actions as follows:</p>
  <p>Program/script:
  &quot;C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXE&quot;</p>
  <p>Add arguments (optional):
  &quot;C:\myexcel.xlsm&quot;</p>
  <p>This works ine with the option to &quot;Run only when user is logged on&quot; in the General tab is selected
  (I can Run it manually and it also triggers if I set the time for a minute from now or something)
  But obviously I don't want to be logged in all the time, as I want to set the macro to run overnight.</p>
  <p>But if I change this optn to &quot;Run whether user is logged on or not&quot;
  then it doesn't work, I can't trigger manually, and I can't click on Run.</p>
  <p>I found this page during my search, but it doesn't seem to answer my problem</p>
  <p><a href="https://stackoverflow.com/questions/25752296/task-scheduler-cannot-open-batch-file-when-set-to-run-whether-user-is-logged-on">Task scheduler cannot open batch file when set to run whether user is logged on or not</a></p>
  <p>Has anyone encountered this before? Or have a suggestion as to how I can get this to work.</p>