Chip Pearson : Playing WAV Files From VBA
http://www.cpearson.com/excel/excelM.htm#PlayWAV
A the top of a module outside of any procedures, place the following
declaration.
Declare Function sndPlaySound32 Lib "winmm.dll" Alias _
"sndPlaySoundA" (ByVal lpszSoundName As String, _
ByVal uFlags As Long) As Long
Then, to call the function, passing it the name of the WAV file you
want to play:
Call sndPlaySound32("c:\test\MySound.WAV", 0)
-------------------------------------------------------------------------------------------------------
Just some background references on using events :
David McRitchie
http://www.mvps.org/dmcritchie/excel/event.htm
Chip Pearson
http://www.cpearson.com/excel/events.htm
Right click the sheet that contains the cell that changes. Select
'View Code'. Place the following code in the sheet's module. Adjust
the references as needed.
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target = Range("A1") Then
If Target.Value > 20 Then _
Call sndPlaySound32("c:\test\MySound.WAV", 0)
End If
End Sub