Const SND_SYNC = &H0
Const SND_ASYNC = &H1
Const SND_FILENAME = &H20000
Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" _
(ByVal lpszName As String, _
ByVal hModule As Long, _
ByVal dwFlags As Long) As Long
Sub PlayWAVFile(Optional Async As Boolean = True)
Dim WavFile As String
WavFile = "tada.wav"
WavFile = "C:\Windows\Media\" & WavFile
If Async Then
Call PlaySound(WavFile, 0&, SND_ASYNC Or SND_FILENAME)
Else
Call PlaySound(WavFile, 0&, SND_SYNC Or SND_FILENAME)
End If
End Sub
--
HTH
Bob Phillips
(replace somewhere in email address with gmail if mailing direct)
"JLGWhiz" <JLGWhiz@discussions.microsoft.com> wrote in message
news:212A4DEA-FE14-4708-BFF5-77C252821B06@microsoft.com...
> Based on what I can glean from other threads, it seems that I could not
call
> the tada.wav using VBA code in Excel 2003. If this is not true, what is
the
> code. I have tried the XL2000 code and it did not work. Thanks.
Bookmarks