Setting the schedule for a macro from a text file
Moderators: JRL, Dorian (MJT support)
Setting the schedule for a macro from a text file
I am writing a VB application and would like to set the schedule parameters to run a macro at a specific time weekly. Is it possible to write a text file with time, date, etc parameters from VB that macro scheduler will read and in turn set the schedule for the macro I wish to run? If so, any tips would be great.
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
A few quick thoughts:
1. If you an NT family (NT, 2K, XP) operation system, then you can probaly use AT command.
2. A simple process might just have VB write a time to an INI file.
Macro Scheduler could run periodically, read the INI file and continue or end if current time is not within window of time set in INI file. Some Wait> and Loop>s could help.
3. Make a copy of C:\Program Files\MJT Net Ltd\Macro Scheduler\macros.dat file, write the sechedule changes to the macro.dat file. After starting the macro, restore original macro.dat file. You will have to look at macro.dat file to understand where to make the changes. Or the replacement file could possible a single line macro.dat file that is modified vs. an edited copy of the original. (Not tested, may have a sharing problem while Macro Scheduler is running, so may need to Close Macro Scheduler, Swap temp macro.dat file, Start Macro Scheduler, run macro per the schedule in the macro.dat file, Close Macro Scheduler, replace origninal macro.dat file, Restart Macro Scheduler).
4. Macro Scheduler will trigger when another Window appears, so perhaps some other program will start, or could be forced to start at that time.
Again, these were just quick and not thorougly thought out, but someone else will probably have an easier method. I usually worry about function first, and pretty and short afterwards.
1. If you an NT family (NT, 2K, XP) operation system, then you can probaly use AT command.
2. A simple process might just have VB write a time to an INI file.
Macro Scheduler could run periodically, read the INI file and continue or end if current time is not within window of time set in INI file. Some Wait> and Loop>s could help.
3. Make a copy of C:\Program Files\MJT Net Ltd\Macro Scheduler\macros.dat file, write the sechedule changes to the macro.dat file. After starting the macro, restore original macro.dat file. You will have to look at macro.dat file to understand where to make the changes. Or the replacement file could possible a single line macro.dat file that is modified vs. an edited copy of the original. (Not tested, may have a sharing problem while Macro Scheduler is running, so may need to Close Macro Scheduler, Swap temp macro.dat file, Start Macro Scheduler, run macro per the schedule in the macro.dat file, Close Macro Scheduler, replace origninal macro.dat file, Restart Macro Scheduler).
4. Macro Scheduler will trigger when another Window appears, so perhaps some other program will start, or could be forced to start at that time.
Again, these were just quick and not thorougly thought out, but someone else will probably have an easier method. I usually worry about function first, and pretty and short afterwards.

Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!