Thursday, July 19, 2007

Drive Your Dog Crazy with VBA


Sub DriveTheDogCrazy()

Dim i As Integer
Dim j As Integer
Randomize (Timer)

For i = 1 To 500
j = Round(20 * Rnd()) 'sec. between doorbell dings
Application.Wait (Now + j / 86400)
Shell ("C:\Program Files\Winamp\winamp.exe c:\doorbell.mp3")
Next i

End Sub

Labels: