ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel/Visual Basic (https://www.excelbanter.com/excel-programming/313266-excel-visual-basic.html)

MikeS[_2_]

Excel/Visual Basic
 
I am using the "timer function" in a macro to re-run a web query after a set
amount of time. I use this to update weather information and the current
company stock price for a "Video Bulletin Board". The problem is, the macro
aborts every night at 11:59. Can anyone tell me why this is happening and
how to fix it?

Thanks in advance.

Myrna Larson

Excel/Visual Basic
 
Probably because the time gets reset to 0 at midnight. Are you using an OnTime
macro for this? If not, you could try it. With that approach, the last line of
the macro typically sets up the next run, at a specific time. That time can
include a date. That would take care of the midnight problem.

On Tue, 12 Oct 2004 06:51:04 -0700, "MikeS"
wrote:

I am using the "timer function" in a macro to re-run a web query after a set
amount of time. I use this to update weather information and the current
company stock price for a "Video Bulletin Board". The problem is, the macro
aborts every night at 11:59. Can anyone tell me why this is happening and
how to fix it?

Thanks in advance.



MikeS[_2_]

Excel/Visual Basic
 
I'm not sure if I fully understand your reply. I'm not actually using a
fixed or set time - I am having it loop back to the beginning after a set
number of seconds. I was thinking more along the lines of using an "error"
or "onerror" function to call another macro in (the event of an error) that
would restart the original macro. I know you can do this in Access but I'm
not sure how or if this will work in Excel. Can you elaborate on this?

Thanks

MikeS

"Myrna Larson" wrote:

Probably because the time gets reset to 0 at midnight. Are you using an OnTime
macro for this? If not, you could try it. With that approach, the last line of
the macro typically sets up the next run, at a specific time. That time can
include a date. That would take care of the midnight problem.

On Tue, 12 Oct 2004 06:51:04 -0700, "MikeS"
wrote:

I am using the "timer function" in a macro to re-run a web query after a set
amount of time. I use this to update weather information and the current
company stock price for a "Video Bulletin Board". The problem is, the macro
aborts every night at 11:59. Can anyone tell me why this is happening and
how to fix it?

Thanks in advance.




Myrna Larson

Excel/Visual Basic
 
Can you post the code? Have you used a Timer control? I am suggestion that you
use an OnTime macro. Check it out in Help. Basically, you set a fixed time for
the macro to run. When that happens, the last line in the macro "schedules"
the next run, based on the current date and time plus the required number of
seconds.

On Tue, 12 Oct 2004 07:17:05 -0700, "MikeS"
wrote:

I'm not sure if I fully understand your reply. I'm not actually using a
fixed or set time - I am having it loop back to the beginning after a set
number of seconds. I was thinking more along the lines of using an "error"
or "onerror" function to call another macro in (the event of an error) that
would restart the original macro. I know you can do this in Access but I'm
not sure how or if this will work in Excel. Can you elaborate on this?

Thanks

MikeS

"Myrna Larson" wrote:

Probably because the time gets reset to 0 at midnight. Are you using an

OnTime
macro for this? If not, you could try it. With that approach, the last line

of
the macro typically sets up the next run, at a specific time. That time can
include a date. That would take care of the midnight problem.

On Tue, 12 Oct 2004 06:51:04 -0700, "MikeS"


wrote:

I am using the "timer function" in a macro to re-run a web query after a

set
amount of time. I use this to update weather information and the current
company stock price for a "Video Bulletin Board". The problem is, the

macro
aborts every night at 11:59. Can anyone tell me why this is happening and
how to fix it?

Thanks in advance.






All times are GMT +1. The time now is 02:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com