Your code worked fine for me. (it performed as I would expect based on how
it is written).
Do you have the code in the sheet module?
Is your sound turned on?
Is the value in I1 of the sheet containing the code increasing?
Is calculation set to automatic?
--
Regards,
Tom Ogilvy
"Carlton Patterson" wrote in message
...
OK,
while waiting for help I put this together but still couldn't get the
sound to work!
Private Declare Function PlaySound Lib "winmm.dll" _
Alias "PlaySoundA" (ByVal lpszName As String, _
ByVal hModule As Long, ByVal dwFlags As Long) As Long
Const SND_SYNC = &H0
Const SND_ASYNC = &H1
Const SND_FILENAME = &H20000
Sub PlayWAV()
WavFile = "chimes.wav"
WavFile = "C:\WINDOWS\Media\chimes.wav"
Call PlaySound(WavFile, 0&, SND_ASYNC Or SND_FILENAME)
End Sub
Private Sub Worksheet_Calculate()
Static prevValue
If Range("I1").Value prevValue Then
WavFile = "chimes.wav"
WavFile = "C:\WINDOWS\Media\chimes.wav"
Call PlaySound(WavFile, 0&, SND_ASYNC Or SND_FILENAME)
prevValue = Range("I1").Value
End If
End Sub
Carlton
*** Sent via Developersdex http://www.developersdex.com ***