Hello:
Suppose in an excel Row I have a series of time values (hours of a day). For example, Row 4 has the following series along columns:
7:00:00; 8:10:00; 10:30:00; 15:23:00
The mission of this macro is:
- Check the first timestamp
- Schedule a web sample (scraping) at this time
- Do the sample when this time is reached
- Copy and paste values sampled in another page (already solved)
- Get next timestamp
This macro should start when a button is pressed and finished after current time is greater than the rightmost timestamp.
My only concern is how to schedule this sampling at that given time.
I've tried something like this inside a loop:
Application.OnTime NextSampleTime, "Sampling Sub"
I guessed that this code, when invoked, remained in standby until current time reached the timestamp and then sampled and continued, but it doesn't do such thing. It doesn't wait until next moment
Do you know any way of doing this?
Some conditions I need to meet:
- The sampling should be handled by excel (the macro itself) and not by some windows task scheduler that opens and closes excel each time
- Only one time at any given time of day should someone press the Start button, and sampling should go on until last timestamp
- The processor use should be minimal (i.e. There's got to be that's not checking the time on each millisecond, but rather scheduling tasks ahead)
Thanks in advance!
Suppose in an excel Row I have a series of time values (hours of a day). For example, Row 4 has the following series along columns:
7:00:00; 8:10:00; 10:30:00; 15:23:00
The mission of this macro is:
- Check the first timestamp
- Schedule a web sample (scraping) at this time
- Do the sample when this time is reached
- Copy and paste values sampled in another page (already solved)
- Get next timestamp
This macro should start when a button is pressed and finished after current time is greater than the rightmost timestamp.
My only concern is how to schedule this sampling at that given time.
I've tried something like this inside a loop:
Application.OnTime NextSampleTime, "Sampling Sub"
I guessed that this code, when invoked, remained in standby until current time reached the timestamp and then sampled and continued, but it doesn't do such thing. It doesn't wait until next moment
Do you know any way of doing this?
Some conditions I need to meet:
- The sampling should be handled by excel (the macro itself) and not by some windows task scheduler that opens and closes excel each time
- Only one time at any given time of day should someone press the Start button, and sampling should go on until last timestamp
- The processor use should be minimal (i.e. There's got to be that's not checking the time on each millisecond, but rather scheduling tasks ahead)
Thanks in advance!