+ Reply to Thread
Results 1 to 2 of 2

Detect Excel was started with Windows Task Scheduler

  1. #1
    RB Smissaert
    Guest

    Detect Excel was started with Windows Task Scheduler

    Using Excel 2000 to 2003.
    I need to somehow detect that Excel was started with the Task Scheduler.
    I don't need to open any particular workbook, but Excel has an add-in
    installed that will open
    (but load, so tick under Tools, Add-ins) an other add-in. This second add-in
    will run code
    with the workbook Open event. This code should only run though if Excel was
    started with
    the scheduler.
    I have found only solution sofar, which involves opening a workbook with the
    /p flag with a directory
    as an argument but this doesn't work.
    Thanks for any advice with this tricky problem.

    RBS


  2. #2
    RB Smissaert
    Guest

    Re: Detect Excel was started with Windows Task Scheduler

    Found a solution to this.
    Maybe not the nicest one (the Windows task won't show the Excel icon), but
    it works.
    The Windows task will start a .bat file with this text:

    @echo off
    %1test > c:\zzzzz.txt
    start Excel
    exit

    My add-in will check for the presence of this file and if it is there kill
    it and run the code.
    Will be interested if somebody has a better solution.


    RBS


    "RB Smissaert" <[email protected]> wrote in message
    news:uOZxcl%[email protected]...
    > Using Excel 2000 to 2003.
    > I need to somehow detect that Excel was started with the Task Scheduler.
    > I don't need to open any particular workbook, but Excel has an add-in
    > installed that will open
    > (but load, so tick under Tools, Add-ins) an other add-in. This second
    > add-in will run code
    > with the workbook Open event. This code should only run though if Excel
    > was started with
    > the scheduler.
    > I have found only solution sofar, which involves opening a workbook with
    > the /p flag with a directory
    > as an argument but this doesn't work.
    > Thanks for any advice with this tricky problem.
    >
    > RBS



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1