Like the subject says: I'm looking to run a macro triweekly (every 3 weeks)
ex. Every 3 weeks - Mondays at 8:15a.m
Starting date: Monday 11/20/2006
Under "Run When" in Macro Scheduler, I have:
Days: Monday
Time: 08:15
I've been having to schedule this macro manually, how can I setup MS to do it for me automatically?
Thanks
I need to run a macro triweekly? every 3 weeks... HOW?
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Create an INI file that looks like this:
[MacroName]
LastRun=
Store this in the same folder as your script file. The script will look something like this:
[MacroName]
LastRun=
Store this in the same folder as your script file. The script will look something like this:
Code: Select all
VBSTART
VBEND
ReadIniFile>IniFile.ini,MacroName,LastRun,dtLast
If>dtLast=
//If not already set (first time we've ever run, run)
Let>d=21
Else
VBEval>DateDiff("d",DateValue("%dtLast%"),Date()),dd
Endif
//If last stored run date was 21 days ago then we can run ...
If>d=21
..
.. your code here
..
//Put today's date in Ini file
GetDate>Today
EditIniFile>IniFile.ini,MacroName,LastRun,Today
Endif
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?