dcsimg
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Tip: How to Call a Macro Every "n" Minutes

Macros are useful for automating mundane tasks. Learn how to run a macro at a pre-determined frequency.


advertisement

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


We write a lot of macros to automate many of our mundane repeated tasks. Taking it to the next level, we can call the macro in a pre-determined frequency and get the macro triggered.

See below for an example:

Sub MainMacroMethod()
  ' Begin macro code
  ' This method contains the macro???s code.
  ' End macro code
 
'Call a method at the end that will set a timer
 Call timerMethod
 
 End Sub

Sub timerMethod ()
   'Set a timer that will trigger the above method in the next 6 minutes
    Application.OnTime Now + TimeValue("00:06:00"), "MainMacroMethod"
End Sub 

 

Visit the DevX Tip Bank

 





   
Srinath M. S. says: "I would love to leave a footprint in this flat world."
Thanks for your registration, follow us on our social networks to keep up-to-date