title: Loop with Application.OnTime
body: <p>I have a program that is working but I am trying to improve it.
  The actual code is like this:</p>
  
  <pre><code>Sub Main()
      frequencyinterval = Now + TimeValue("00:00:10")
      Application.OnTime frequencyinterval, "Sheet1.Subordinate"
  End Sub
  
  Sub Subordinate
      'Do some things
      Call Sheet1.Main 
  End Sub
  </code></pre>
  
  <p>It seems to me that something like this would be better than calling Main from the sub. Problem is that it shuts down Excel.</p>
  
  <pre><code>Do While Cells(10, 1).Value = "Running"
      Frequencyinterval = Now + TimeValue("00:00:10")
      Application.OnTime frequencyinterval, "Sheet.Main"
  Loop
  </code></pre>
  
  <p>I would appreciate any suggestions.</p>
  
  <p>I thought that recursive calls were bad. However, nothing else works. A wait within the do while stops the data feed of incomong stock prices.</p>
  
  <p>After the program has run for a few hours my computer goes into slow motion and later just locks up.</p>