View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ryan H Ryan H is offline
external usenet poster
 
Posts: 489
Default Run Sub automatically on periodic basis

This code will run your procedure when the workbook has been opened. At the
end of your code the OnTime event will schedule another run of your code 30
seconds later. Thus, it will continue to loop until you close the workbook.
Hope this helps! If so, let me know, click "YES" below.

Private Sub Workbook_Open()
Call my_Procedure
End Sub

Sub my_Procedure()

' your code here

Application.OnTime EarliestTime:=Now + TimeValue("00:00:30"),
Procedu="my_Procedure"

End Sub
--
Cheers,
Ryan


"Paul Kraemer" wrote:

Hi,

I am using Excel 2007. I have written a Subroutine that I want to run
automatically once every thirty seconds without any user interaction. Can
anyone tell me how I can set this up?

Thanks in advance,
Paul

--
Paul Kraemer