View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Helmut Weber Helmut Weber is offline
external usenet poster
 
Posts: 15
Default Saving a file every fifteen minutes

Hi Priyanka,

Sub StartIt()
Do While Time < TimeValue("4:50PM")

....
Loop
End Sub


Now the problem is, the computer hangs when i run this macro.


"Do While Time < TimeValue("4:50PM")" is a deadly sin.
It makes the computer run the code uninterruptedly until "4:50PM".
If you want code which executes every 15 Minutes after "4:50PM"
you might put "if timevalue ("4:50PM")" in Macro1.
And there is the call to startit (again) missing as well in Macro1.

Programming with times is a special challenge.
I think your code would stop at midnight, by the way.
--

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Vista Small Business, Office XP