View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
chalky[_9_] chalky[_9_] is offline
external usenet poster
 
Posts: 1
Default Playing a WAV file in Excel 2002


I have the following code to play a WAV file in excel:

Sub PlayWavFile(WavFileName As String, Wait As Boolean)
If Dir(WavFileName) = "" Then Exit Sub ' no file to play
If Wait Then ' play sound before running any more code
sndPlaySound WavFileName, 0
Else ' play sound while code is running
sndPlaySound WavFileName, 1
End If
End Sub

where the file name is c:\accounts\05\temp\sound.wmv

I am really struggling to put this macro together, can anyone lay it
out in a slightly easier to follow format?

Thanks
chris


--
chalky
------------------------------------------------------------------------
chalky's Profile: http://www.excelforum.com/member.php...o&userid=23758
View this thread: http://www.excelforum.com/showthread...hreadid=504003