Task Scheduler Is Not Opening An Excel File, Please Help

Joel 40 Reputation points
2024-10-07T10:20:09.7466667+00:00

I am trying to open an Excel xlsm file using Task Scheduler but cannot get it to work.

I have configured the Action tab in a number of different ways but no matter what I do I cannot get the Excel to open let alone get the Excel file to open (i.e., nothing happens at the specified time or when I try to run the scheduled task manually)

The current configuration has the action tab configured as follows (which has solved the problem for some):

  • Program Script = path to Excel
  • Strat in (Optional) = path to Excel *.xlsm file

I am running an ARM version of Windows 11.

Thank you.

Windows
Windows
A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
5,504 questions
Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
1,969 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,996 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
9,916 questions
0 comments No comments
{count} votes

Accepted answer
  1. MotoX80 34,431 Reputation points
    2024-10-09T01:49:56.17+00:00

    Make sure the task is set to "Run only when user is logged on".

    Full explanation: There are 2 types of Windows programs, command line (console) programs like icacls.exe, and graphical (GUI) programs like Excel.

    If you have a requirement to "Run whether the user is logged on or not", then you should only execute command line (console) programs. I refer to this as "unattended execution".

    User's image

    The issue is that GUI programs expect to interact with a desktop user who can "click on OK to continue" message boxes. If the task is set to "Run whether the user is logged on or not", the desktop user has no access to the GUI. There is no way to click on anything. There is no way to "see" the window that the program produces. About the only thing that you can do is to use the task manager to see if the program is running and force kill any instances.

    Command line (console) programs work well for unattended execution because you can capture stdout and stderr and see what messages a program produces.

    See my answer to this question.

    https://learn.microsoft.com/en-us/answers/questions/2099831/windows-11-task-scheduler-not-working-for-some-tas

    Graphical (GUI) programs like Excel should be set to run only when the user is logged on. That way the program will be visible to the desktop user and can interact with it. If Excel can't find your .xlsm file, then it should show an error message.

    2 people found this answer helpful.

4 additional answers

Sort by: Most helpful
  1. Jiajing Hua-MFST 10,885 Reputation points Microsoft Vendor
    2024-10-08T07:21:20.58+00:00

    Hi

    Please enter "path to Excel *.xlsm file" in "Add arguments (optional)" box instead of "Strat in (optional)" for a check.

    User's image


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


    0 comments No comments

  2. Joel 40 Reputation points
    2024-10-08T10:53:59.95+00:00

    @Jiajing Hua-MFST

    As a start, thank you for the assistance.

    I tried making the changes you suggested and it did not work.

    Still looking for a solution.

    Thank you.


  3. Joel 40 Reputation points
    2024-10-09T07:56:59.0333333+00:00

    @MotoX80 good morning (at least where I am).

    I tried your suggestion and am happy to report that the Task Scheduler now works perfectly.

    I want to extend a huge thank you for solving my problem. MUCH THANKS!

    One follow up: Is there a way to rename a Scheduled Task or does one have to recreate the Scheduled Task (as I suspect is the case).

    Thank you,

    Joel


  4. Joel 40 Reputation points
    2024-10-09T12:52:02.92+00:00

    @MotoX80

    Appreciate the further help / suggestion; that is exporting and reimporting the XML worked like a charm. Huge thank you!

    Joel

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.