You are on page 1of 1

Suffit de demander!... Private Declare Function PlaySound32 Lib "winmm.

dll" Alias "PlaySoundA" (ByVal IpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long Const SND_SYNC = &H0 Const SND_ASYNC = &H1 Const SND_FILENAME = &H20000 ' archives mpfe Sub PlayWAV() ' snd_async: son asynchrone (la musique n'arrete pas le programme) If Application.CanPlaySounds Then WAVFile = ThisWorkbook.Path & "\" & "atmosph.wav" Call PlaySound32(WAVFile, 0&, SND_ASYNC Or SND_FILENAME) Else Exit Sub End If End Sub

1. Re : Jouer un son (VBA) Re, Ou bien a dans un module standard... de Denis Michon. Code : Declare Function sndPlaySound32 Lib "C:\WINDOWS\SYSTEM32\winmm.dll" _ Alias "sndPlaySoundA" (ByVal lpszSoundName As String, _ ByVal uFlags As Long) As Long Sub Son() Call sndPlaySound32(ThisWorkbook.Path & "\SON_0.Wav", 0) End Sub Celui l il fonctionne

You might also like