Hi penzer
OK, so you're trying to play an MP3 file from within Excel - this is particularly difficult. I've never actually tried it myself, and might have a go next week when I have some time, but you might like to have a look at these two threads that give some instruction on how to do it :
http://www.mrexcel.com/forum/showthread.php?t=293213
http://www.mrexcel.com/forum/showthread.php?t=167671
...but be warned it is heavy going.
However, if you can convert your tracks to .wav (search Google for a free tool) then the task becomes much easier - use this code :
Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
Const SND_SYNC = &H0
Const SND_ASYNC = &H1
Const SND_FILENAME = &H20000
Sub PlayMyWAV()
Call PlaySound("C:/MyWavFile.wav", 0&, SND_ASYNC Or SND_FILENAME)
End Sub
Just run the code PlayMyWAV to kick the whole thing off.
HTH
DominicB
Bookmarks