Option Explicit
Private Declare Function PlaySound Lib "winmm.dll" _
Alias "PlaySoundA" (ByVal lpszName As String, _
ByVal hModule As Long, ByVal dwFlags As Long) As Long
Private Const SND_PURGE = &H40 'Stop la lecture du fichier
Private Sub Workbook_Open()
Call PlaySound(ThisWorkbook.Path & "\nom de ton fichier.wav", 0&, &H1 Or &H20000)
Randomize
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
PlaySound vbNullString, ByVal 0&, SND_PURGE
End Sub