Ejecutar una macro en Excel a una hora determinada o cada cierto tiempo con OnTime VBA @EXCELeINFO

Sergio Alejandro Campos - EXCELeINFO
Sergio Alejandro Campos - EXCELeINFO
52 هزار بار بازدید - 6 سال پیش - ✅ Download the file |
✅ Download the file | http://www.exceleinfo.com/ejecutar-un...
🏆 Subscribe | https://goo.gl/M5zNA8

In this tutorial we will see how to schedule or schedule the execution of macros at certain times or from time to time. Suppose you share a file in network and if your colleagues do not close the file, it closes automatically at a certain time. To execute macros in the future we will use the OnTime method in VBA.

By using the OnTime method we will see 3 ways to schedule the execution of macros:

- Execute a macro in n amount of time, for example, execute it in half an hour.
- Run a macro every second, or the time you define.
-Run a macro at a certain time.

How the OnTime method works

As I have explained, the OnTime method will help us to schedule or schedule the execution of macros at a specific time or within a certain time. Below I list the OnTime parameters and their explanation.

-EarliestTime It is the time at which the macro will run.
-Procedure. It is the name of the macro or procedure that will be executed.
-LastestTime. It is the time in which the macro can be re-executed in case Excel is busy at the scheduled time. For example if we want the macro to be executed in 30 seconds, in this parameter we would put EarliestTime + 30. Only a second attempt will be made.
-Schedule. If we omit this parameter by default it will be true, that is, it will execute a procedure. If we put False to it, it will cancel the execution of the macro or procedure.

More examples | http://www.exceleinfo.com
More examples | http://blogs.itpro.es/exceleinfo
Facebook Page | Facebook: EXCELeINFO
Get notificacions on Telegram | https://t.me/EXCELeINFO
Twitter | @EXCELeINFO
Twitter | @SergioACamposH

Download EXCELeINFO addin:
http://addin.exceleinfo.com

Photo by Sonja Langford on Unsplash
6 سال پیش در تاریخ 1397/02/20 منتشر شده است.
52,058 بـار بازدید شده
... بیشتر