Have a Macro run farther than 24 hours in the future...

Within Excel XP and VBA, is there a way, using Application.OnTime or some other method, to schedule a macro to execute once at a period more than 24 hours in the future?

I'm trying to avoid using the Windows Task Schedule because it has a habit of crashing  Excel for some reason.
dhienzschAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

[ fanpages ]IT Services ConsultantCommented:
Hi,

In the routine you had identified as your "OnTime" event, check the current system date (using "Now()") to see if the date you wish the code to run has been reached.  If the date is still in the future, reschedule the "OnTime" event.  24 hours later the routine will trigger again, and eventually the date required will match the system date.

BFN,

fp.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dhienzschAuthor Commented:
I haven't forgotten about this question... I just haven't had time to test yet.

D
0
[ fanpages ]IT Services ConsultantCommented:
:)

That's OK... no rush... we've still got time ;)
0
dhienzschAuthor Commented:
Wow... completely spaced providing a response.  

The suggestion worked.  I use a routine where I use NOW to check the system day and if it is anything other than the day I want, I make it sleep for 24 hours from the current time - 15 minutes (so it doesn't cause itself to run continuously).  

Note, this won't work if Macro security level is set to high.
0
[ fanpages ]IT Services ConsultantCommented:
Glad we got there in the end.

Thanks for the points/grading.

BFN,

fp.
[ http://NigelLee.info ]
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.