ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Time events to trigger VB (corrected) (https://www.excelbanter.com/excel-programming/282907-time-events-trigger-vbulletin-corrected.html)

David Robinson[_3_]

Time events to trigger VB (corrected)
 
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.
..



Merry

Time events to trigger VB (corrected)
 
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.

Merry

Time events to trigger VB (corrected)
 
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.

Merry

Time events to trigger VB (corrected)
 
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

Time events to trigger VB (corrected)
 

Thanks. How do I make a VB program executable?

-----Original Message-----
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.
.


fred

Time events to trigger VB (corrected)
 
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/de...l/vbstutor.asp

Good Luck
Fred


"David" wrote in message
...

Thanks. How do I make a VB program executable?

-----Original Message-----
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.
.




Merry[_2_]

Time events to trigger VB (corrected)
 
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.


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

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