title: Macro Fails, 'The macro may not be available in this...'
body: <p>Hello and thank you in advance for your assistance.  </p>
  
  <p>I have some code that I admittedly borrowed from a site.  It changes the sheet that is being displayed every X seconds.  In my case 3 seconds.  When I run it it will change to the next sheet one time and then error out after the 3 seconds.</p>
  
  <p>The error I receive is "Cannot run the macro "C:\users\BenjaminSmith\Desktop\Book1.xlsm'!displaysheets'. The Macro may not be available in this workbook or all macros may be disabled."</p>
  
  <p>Here is the code for my Macro</p>
  
  <pre><code>Sub displaysheets()
  
  ShtNum = ActiveSheet.Index
  
  ShtNum = ShtNum + 1
  If ShtNum &gt; Sheets.Count Then
  ShtNum = 1
  End If
  Sheets(ShtNum).Activate
  Application.OnTime Now + TimeValue("00:00:03"), "displaysheets"
  
  
  End Sub
  </code></pre>
  
  <p>If I remove the line</p>
  
  <pre><code>Application.OnTime Now + TimeValue("00:00:03"), "displaysheets"
  </code></pre>
  
  <p>I can run the macro over and over and there are no issues.  Other than the fact it doesn't continue on its own...</p>
  
  <p>The spreadsheet is an XLSM.
  MS VBA is 7.0.
  Excel is 2010.</p>
  
  <p>I am thinking maybe the issue is because the code is recursive?</p>
  
  <p>Thanks for your suggestions.</p>