Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sam Sam is offline
external usenet poster
 
Posts: 699
Default stuck on the timing refresh....

Guys - trying to get the following subs to run every 10 seconds...i mean -
i'd just like to run sub master_trade every ten seconds but can't figure out
how to do it?


Sub Master_Trade()

Flip_Trade
Flip_Bid
Flip_Ask
STEP1
STEP2

Application.OnTime Now + TimeValue("00:00:10"), "Flip_Trade"
Application.OnTime Now + TimeValue("00:00:10"), "Flip_Bid"
Application.OnTime Now + TimeValue("00:00:10"), "Flip_Ask"
Application.OnTime Now + TimeValue("00:00:10"), "STEP1"
Application.OnTime Now + TimeValue("00:00:10"), "STEP2"

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default stuck on the timing refresh....

Sam,
have a look at this site & see if heps you:

http://www.ozgrid.com/Excel/run-macro-on-time.htm
--
jb


"Sam" wrote:

Guys - trying to get the following subs to run every 10 seconds...i mean -
i'd just like to run sub master_trade every ten seconds but can't figure out
how to do it?


Sub Master_Trade()

Flip_Trade
Flip_Bid
Flip_Ask
STEP1
STEP2

Application.OnTime Now + TimeValue("00:00:10"), "Flip_Trade"
Application.OnTime Now + TimeValue("00:00:10"), "Flip_Bid"
Application.OnTime Now + TimeValue("00:00:10"), "Flip_Ask"
Application.OnTime Now + TimeValue("00:00:10"), "STEP1"
Application.OnTime Now + TimeValue("00:00:10"), "STEP2"

End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default stuck on the timing refresh....

Sam

This goes in a general module

Sub Master_Trade()
Application.OnTime Now + TimeValue("00:00:10"), "Master_Trade"

Flip_Trade
Flip_Bid
Flip_Ask
STEP1
STEP2

End Sub

and to kick things off this goes in the workbook_open event

Private Sub Workbook_Open()
Application.OnTime Now + TimeValue("00:00:10"), "Master_Trade"
End Sub

Mike

"Sam" wrote:

Guys - trying to get the following subs to run every 10 seconds...i mean -
i'd just like to run sub master_trade every ten seconds but can't figure out
how to do it?


Sub Master_Trade()

Flip_Trade
Flip_Bid
Flip_Ask
STEP1
STEP2

Application.OnTime Now + TimeValue("00:00:10"), "Flip_Trade"
Application.OnTime Now + TimeValue("00:00:10"), "Flip_Bid"
Application.OnTime Now + TimeValue("00:00:10"), "Flip_Ask"
Application.OnTime Now + TimeValue("00:00:10"), "STEP1"
Application.OnTime Now + TimeValue("00:00:10"), "STEP2"

End Sub

  #4   Report Post  
Posted to microsoft.public.excel.programming
Sam Sam is offline
external usenet poster
 
Posts: 699
Default stuck on the timing refresh....

Hi Mike, Firstly, thanks.

I have replaced Master Sub with what you have written, and then placed the
private sub in the open workbook - but it still doesn't sem to be updating...?

"Mike H" wrote:

Sam

This goes in a general module

Sub Master_Trade()
Application.OnTime Now + TimeValue("00:00:10"), "Master_Trade"

Flip_Trade
Flip_Bid
Flip_Ask
STEP1
STEP2

End Sub

and to kick things off this goes in the workbook_open event

Private Sub Workbook_Open()
Application.OnTime Now + TimeValue("00:00:10"), "Master_Trade"
End Sub

Mike

"Sam" wrote:

Guys - trying to get the following subs to run every 10 seconds...i mean -
i'd just like to run sub master_trade every ten seconds but can't figure out
how to do it?


Sub Master_Trade()

Flip_Trade
Flip_Bid
Flip_Ask
STEP1
STEP2

Application.OnTime Now + TimeValue("00:00:10"), "Flip_Trade"
Application.OnTime Now + TimeValue("00:00:10"), "Flip_Bid"
Application.OnTime Now + TimeValue("00:00:10"), "Flip_Ask"
Application.OnTime Now + TimeValue("00:00:10"), "STEP1"
Application.OnTime Now + TimeValue("00:00:10"), "STEP2"

End Sub

  #5   Report Post  
Posted to microsoft.public.excel.programming
Sam Sam is offline
external usenet poster
 
Posts: 699
Default stuck on the timing refresh....

It's working - got it...Thank you Mike...legend as usual.

"Mike H" wrote:

Sam

This goes in a general module

Sub Master_Trade()
Application.OnTime Now + TimeValue("00:00:10"), "Master_Trade"

Flip_Trade
Flip_Bid
Flip_Ask
STEP1
STEP2

End Sub

and to kick things off this goes in the workbook_open event

Private Sub Workbook_Open()
Application.OnTime Now + TimeValue("00:00:10"), "Master_Trade"
End Sub

Mike

"Sam" wrote:

Guys - trying to get the following subs to run every 10 seconds...i mean -
i'd just like to run sub master_trade every ten seconds but can't figure out
how to do it?


Sub Master_Trade()

Flip_Trade
Flip_Bid
Flip_Ask
STEP1
STEP2

Application.OnTime Now + TimeValue("00:00:10"), "Flip_Trade"
Application.OnTime Now + TimeValue("00:00:10"), "Flip_Bid"
Application.OnTime Now + TimeValue("00:00:10"), "Flip_Ask"
Application.OnTime Now + TimeValue("00:00:10"), "STEP1"
Application.OnTime Now + TimeValue("00:00:10"), "STEP2"

End Sub



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default stuck on the timing refresh....

Sam,

You can demonstrate you code is being called every 10 seconds like this

Private Sub Workbook_Open()
Application.OnTime Now + TimeValue("00:00:10"), "Master_Trade"
End Sub

and in a general module

Sub Master_Trade()
Application.OnTime Now + TimeValue("00:00:10"), "Master_Trade"
MsgBox "Hello"
'YOUR CODE
End Sub

If you run this you will get a message box every 10 seconds. I have no idea
what the subs you are calling do but if they aren't working then the fault
lies with them and not the routine that calls master_trade every 10 seconds.

Mike

"Sam" wrote:

Hi Mike, Firstly, thanks.

I have replaced Master Sub with what you have written, and then placed the
private sub in the open workbook - but it still doesn't sem to be updating...?

"Mike H" wrote:

Sam

This goes in a general module

Sub Master_Trade()
Application.OnTime Now + TimeValue("00:00:10"), "Master_Trade"

Flip_Trade
Flip_Bid
Flip_Ask
STEP1
STEP2

End Sub

and to kick things off this goes in the workbook_open event

Private Sub Workbook_Open()
Application.OnTime Now + TimeValue("00:00:10"), "Master_Trade"
End Sub

Mike

"Sam" wrote:

Guys - trying to get the following subs to run every 10 seconds...i mean -
i'd just like to run sub master_trade every ten seconds but can't figure out
how to do it?


Sub Master_Trade()

Flip_Trade
Flip_Bid
Flip_Ask
STEP1
STEP2

Application.OnTime Now + TimeValue("00:00:10"), "Flip_Trade"
Application.OnTime Now + TimeValue("00:00:10"), "Flip_Bid"
Application.OnTime Now + TimeValue("00:00:10"), "Flip_Ask"
Application.OnTime Now + TimeValue("00:00:10"), "STEP1"
Application.OnTime Now + TimeValue("00:00:10"), "STEP2"

End Sub

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default stuck on the timing refresh....

Our latest posts crossed, glad I could help and thanks for the feedback.

Mike

"Sam" wrote:

It's working - got it...Thank you Mike...legend as usual.

"Mike H" wrote:

Sam

This goes in a general module

Sub Master_Trade()
Application.OnTime Now + TimeValue("00:00:10"), "Master_Trade"

Flip_Trade
Flip_Bid
Flip_Ask
STEP1
STEP2

End Sub

and to kick things off this goes in the workbook_open event

Private Sub Workbook_Open()
Application.OnTime Now + TimeValue("00:00:10"), "Master_Trade"
End Sub

Mike

"Sam" wrote:

Guys - trying to get the following subs to run every 10 seconds...i mean -
i'd just like to run sub master_trade every ten seconds but can't figure out
how to do it?


Sub Master_Trade()

Flip_Trade
Flip_Bid
Flip_Ask
STEP1
STEP2

Application.OnTime Now + TimeValue("00:00:10"), "Flip_Trade"
Application.OnTime Now + TimeValue("00:00:10"), "Flip_Bid"
Application.OnTime Now + TimeValue("00:00:10"), "Flip_Ask"
Application.OnTime Now + TimeValue("00:00:10"), "STEP1"
Application.OnTime Now + TimeValue("00:00:10"), "STEP2"

End Sub

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
add-in timing problem? Andrew Wiles Excel Programming 0 March 3rd 09 09:38 AM
Advancing Timing lsmft Excel Discussion (Misc queries) 2 April 9th 06 04:04 PM
Timing of automatic query refresh and macro pivot table refresh dutty Excel Programming 2 December 1st 04 07:19 PM
Timing problem David Jenkins[_2_] Excel Programming 2 September 2nd 04 11:39 PM
VB timing question Pakenn Excel Programming 1 June 14th 04 01:37 PM


All times are GMT +1. The time now is 10:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"