Hi all,
I have a Worksheet_Calculate code that each time an event is triggered needs to play a WAV sound on the harddisk... how can i do it?
Many thanks
BC
Hi all,
I have a Worksheet_Calculate code that each time an event is triggered needs to play a WAV sound on the harddisk... how can i do it?
Many thanks
BC
Hello BC,
Place this code in a VBA module. To play the wave file: PlaySound ("file Path and Name")
Macro Code:
'dwFlags Constants
Const SND_SYNC As Long = 0
Const SND_ASYNC As Long = 1
Const SND_FILENAME As Long = &H20000
Const SND_RESOURCE As Long = &H40004
Private Declare Function PlaySnd Lib "winmm.dll" _
Alias "PlaySoundA" (ByVal lpszName As String, _
ByVal hModule As Long, ByVal dwFlags As Long) _
As Long
Public Sub PlaySound(ByVal File_Name As String)
Dim RetVal
RetVal = PlaySnd (File_Name, 0&, SND_ASYNC Or SND_FILENAME)
End Sub
Sincerely,
Leith Ross
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks