MrExcel Publishing
Your One Stop for Excel Tips & Solutions

plz help me guys

Posted by Mkel on January 19, 2002 11:43 AM

Hello guys,

I need you help again. i have been assign to make presentation
using computer for my company . they dont care which program
i use to present it as long as the 5 minutes presentation is
accompany by music. so this is what i try to do.. i need
this music includes when i launch my file (auto_open).
my presentation will be 5 minutes. so how do this music continously play for 5
minutes and it started as soon as i opened my file. FYI , the music is in MP3.
thanks and hope this is possible .

ps : please dont tell me to use power point coz i believe
excel can do any task. thanks and regards and one more
thing. is is possible to include the music in the excel file
(my presentation file that is : present.xls )

Posted by Bariloche on January 19, 2002 12:21 PM


Try this code posted by John Walkenbach on the Excel Programming NG:

Sub PlayMP3()
Cmd = "Start " & Chr(34) & ActiveCell.Text & Chr(34)
Shell Cmd
End Sub

The "activecell" needs to contain the path (e.g, C:\MyMP3s\CoolPresentationMusic.mp3) to your music file. Just use the two code lines in your Auto_Open macro. You could, of course, just hard code the path into your Auto_Open routine too.

The music isn't stored in the Excel workbook, what this code does is launch your media-type player. Set your media-type player to "Repeat" and it will play until you shut it off.

have fun

PS: The code appears to work with any music file. I don't have any MP3 files so I tested it with WAVs and it works regardless. Also, the "Start" command is apparently only appropriate for Windows 9.x. I don't have the code for NT or 2000.