function PlaySound does not work



Hi to everyone,

I have no idea whether this group is the right one for my problem so I just
try (and maybe I'm lucky:-)

I'm getting nowhere in trying to play a .wav-file using the function
Playsound. There's no sound, no noise to be heard when I use this function
in vb(a), actually excel-vba, same thing happens in delphi. It does not
matter if I step through the code one by one or start it via GUI. If I try
via Single-Step-Mode (I hope I've translated it somewhere near the correct
one) at least he (i.e. my computer) takes a little time until he proceeds
to the next step. As if he was doing something... The return-code I'm
getting is 1, so he thinks he's successful.

Nowhere did I cross out anything in the sound volume. If I start the
..wav-file by doubleclick in the explorer, I can hear the sound loud and
clearly, no problem.

I have no idea where to look to solve this little but nevertheless annoying
problem. I know from several other users that they had no problems using my
little function: they could start the .wav-file via vba and heard it.:-)

But I can't.:-(

Does anyone here have an idea or just a link for me?
Any help would be appreciated.

This is the code I used... to no avail:-(

Declare Function sndPlaySound32 Lib "winmm.dll" Alias "sndPlaySoundA"
(ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

Public Sub Klang()
Dim a
a = sndPlaySound32("C:\WINNT\Media\tada.wav", 0)
Debug.Print a
End Sub

Thanks for reading
Greetings from Germany
Susanne

--
Mein System:
Office XP, SP3, aktueller Patchstand
Windows 2000, SP4, aktueller Patchstand
.



Relevant Pages

  • Re: function PlaySound does not work
    ... No Sound Events Are Played ... I don't feel that comfortable with deinstalling and reinstalling system ... that wire/channel is broken... ... Windows 2000, SP4, aktueller Patchstand ...
    (microsoft.public.vb.winapi)
  • Re: Ressourcekonflikte (IRQ 20) - etwas tun?
    ... der andere Sound nicht funktioniert, investieren ich bestimmt nicht ... mehr als 5 Minuten in die Fehlersuche. ... Windows 2000, SP4, aktueller Patchstand ...
    (microsoft.public.de.german.win2000.sonstiges)
  • Re: Sounds when errors appear
    ... sound to whatever the theme they have. ... you can most certainly package a wave file that YOU want them to ... (ByVal lpszSoundName As String, ByVal uFlags As Long) ... The above can go in your main module code. ...
    (microsoft.public.access.formscoding)