Time events to trigger VB (corrected)

  • Thread starter Thread starter David Robinson
  • Start date Start date
D

David Robinson

Is there a way to trigger code using time events eg a
change in the date. I travel a good deal and there are
pricing systems on our office computer which are not
portable. I would like to write code which prompts the
main computer to send price updates once a day. My
colleagues are totally computer illiterate so the trigger
has to be something in the computer.
..
 
Windows has a utility called scheduler that when turned on will allo
you to schedule almost anything to run at a given time, day, week,month,year

You can find it on the Control Panel called Scheduled Tasks. In my world you hav
to have permission to run things on a computer this way. Luckily I've been convincing and,
I've had whole applications wake up in the middle of the night and upload big files - or export stuff
What a time saver. I had the same problem also taking vacations etc. No one else to do it. Save
down time for my users also.
 
P.S> To Do - your VB code need to be an executable.
Add New Task -
Browse for executable -
Wizard will take you thru time/day set up -
TEST!
Done.
 
P.S> - The VB code needs to be an executable - then its real easy - add a new task,
browse for your executable - wizard your way thru the time ; day - done.
Forgot to say how...sorry.
 
David, in your case it would be far easier to use a VB script file.
To create a VB script file just write the VB code in a module then in the
'Project explorer window' right click on the module and export the module.
This will save the file as a '.BAS' file. Now change the file extension to
'.VBS'. The task schedular will run VBS files.
VB Script is not quite the same as VBA but as long as you keep it simple and
don't use procedures or functions you should be fine. If you need your
script to be more complex try microsoft's tutorials on VB script.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/vbstutor.asp

Good Luck
Fred
 
There is a menu option for this within Visual Basic where the code is written
Assuming you don't want to package your code and no other users are using it.
Also I am assuming you have the source code and the Visual Basic Editor
You pick the option and it will create the .exe file. You should
do this on the pc where the code will run
Also, note that if you set this task up on your own pc and forge
it, it will pop off while your working.
 
Back
Top