-
Sep 3rd, 2018, 11:17 PM
#1
Thread Starter
Lively Member
I want to trigger a sub routine every minute.
I have been using "Application.OnTime" to trigger a different sub according to a given hour.
You can can use the same method or some other code if you like.
Thanks....
-
Sep 3rd, 2018, 11:24 PM
#2
Re: I want to trigger a sub routine every minute.
Are you asking a question? If you are, then of course you would use a Timer Control.
-
Sep 4th, 2018, 12:03 AM
#3
Re: I want to trigger a sub routine every minute.
I have no idea what 'Application.OnTime' refers to. As far as I can see, there is no such member in the .NET Framework.
Assuming Windows Forms, you would normally add a Timer component (not control) to your form in the designer and set its Interval to 1000 milliseconds. It will then raise its Tick event approximately every second after you call Start or set Enabled to True.
-
Sep 4th, 2018, 12:18 AM
#4
Thread Starter
Lively Member
Re: I want to trigger a sub routine every minute.
Actually, I just finished the code a few seconds ago and I did use Application.OnTime.
It was a lot easier than I thought. It turns out to be:
Application.OnTime Now + TimeValue("00:00:01"), "EventMinutesMacro"
I did not realize that one could add time to Now.
The use of a VB timer does not seem to work in Excel, which I forgot to mention. ):
-
Sep 4th, 2018, 12:32 AM
#5
Re: I want to trigger a sub routine every minute.
That code is some flavour of VB but it's certainly not VB.NET, so please post in the correct forum in future.
-
Sep 4th, 2018, 02:02 AM
#6
Thread Starter
Lively Member
Re: I want to trigger a sub routine every minute.
Originally Posted by jmcilhinney
That code is some flavour of VB but it's certainly not VB.NET, so please post in the correct forum in future.
Ok, I thought Excel Developer was VB.net so I guess I stand corrected.
Mea Culpa.
-
Sep 4th, 2018, 02:29 AM
#7
Re: I want to trigger a sub routine every minute.
You must have missed the Office Development forum. Also, whatever forum you post in, please provide ALL the relevant information. Even in Office Development, the fact that you're programming for Excel specifically is relevant.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|