ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Detect Excel was started with Windows Task Scheduler (https://www.excelbanter.com/excel-programming/319911-detect-excel-started-windows-task-scheduler.html)

RB Smissaert

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


RB Smissaert

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" wrote in message
...
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




All times are GMT +1. The time now is 08:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com