We are running a code to trigger user for exceeding certain dates. The trigger have to be every 1hr post the 1st trigger. But the system triggers inconsistently right now. Any suggestion how to start & close the loop properly?

dTime = Now + TimeValue("01:00:00")
Application.OnTime dTime, "RunOnTime"

Recommended Answers

All 3 Replies

Just a hint: The "RunOnTime" procedure must be declared public and must be available in a module to be triggered, now and also at the expected time, so the best place to store it is at the personal macro workbook.

To create a such workbook, please read here

Hope this helps

lolafuertes thanks alot for the reply.. I do have one created.. Only have issues when you run the trigger time which has to be post 1hr and repeats it self every 1hr that doesnt work. The repetition works the 1st time and subsequent trigger was every minute. Do i need to do the DO...While.. or the Repeat for this app?

Seems to me you may not be resetting the time you want to check for....seems like after first run the code thinks it has passed the threshold again right after it just fired. Check your variables and make sure it is set to be +1 hr right after it fires the first time.

Just my 2 cents,
larry

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.