In the VB editor, click Insert/Module on the menu bar and put this part of
Bernie's code in the code window that appears...
Public Declare Function sndPlaySound Lib "winmm.dll" _
Alias "sndPlaySoundA" (ByVal lpszSoundName As String, _
ByVal uFlags As Long) As Long
Sub PlayWavFile(WavFileName As String)
sndPlaySound WavFileName, 1
End Sub
Now, in the code window for your worksheet (where I think you originally
placed Bernie's code), delete the code you got from Bernie earlier and just
put this part of it in there instead...
Sub TestPlayWavFile()
PlayWavFile "C:\WINDOWS\Media\Windows XP Startup.Wav"
End Sub
This last code is actually a substitute for your own macro if you have one.
If you have your own macro, then put the PlayWavFile statement in it and run
that macro; if you do NOT have your own macro, then just run the
TestPlayWavFile macro instead.
Rick