View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Adding Sound to Program

Paste this program in a new module

Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal dwDuration
As Long) As Long

Sub Beep1()
Dim num As Single
Dim num1 As Long
Dim numLoops As Single
num = 10
NumSeconds = 4
numLoops = (NumSeconds * num * 2) / 2
If numLoops < 1 Then
numLoops = 1
End If
num1 = 1000 / (num * 2)

For i = 1 To numLoops
'DoEvents
Beep 500, num1
'DoEvents
Beep 10000, num1
'DoEvents
Next
End Sub


-----------------------------------
Execute/run the Beep1 macro.

While it is running see where the beep is coming from - From your sound
card, or from your system unit itself?

Playsound should come from your sound card, but I would expect beep to come
from the built in speaker of your computer.

--
Regards,
Tom Ogilvy

"Carlton Patterson" wrote in message
...
Hi Bob,


Thats great mate.

Cheers mate

Carlton

*** Sent via Developersdex http://www.developersdex.com ***