Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As Any, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
Private Sub Workbook_Open() 'Lecture d'un son MIDI
Dim ret As Long, nNomf As String
nNomf = ThisWorkBook.path & "\" & "Musique1.MID" 'adapter le chemin et le nom de la musique à jouer
ret = mciSendString("open " & nNomf, 0&, 0, 0)
ret = mciSendString("Play " & nNomf, 0&, 0, 0)
End Sub