Macro to play wave file

Y

yo beee

Vasant helped me with the code below and it works great. It's designed to
play a wave file. Problem is, I want it to play a long wave file - about 1
minute long all the way through to the end, but it only plays about 10 sec.
Any ideas?
TIA
yobeee

Declare Function PlaySound Lib "winmm.dll" _
Alias "PlaySoundA" (ByVal lpszName As String, _
ByVal hModule As Long, _
ByVal dwFlags As Long) As Long

Sub PlayMe1()
Dim retval As Long
retval = PlaySound("C:\my documents\my folder\wav1.wav", 0, &H20000)
End Sub
 
G

Greg Koppel

First embed the wav file in Excel by Insert/Object/Create from file

Sub MusicDemo()
Worksheets("sheet1").OLEObjects(1).Verb
End Sub

Verb is a generic metehod that uses the appropriate associated program for
an object embedded in Excel.

HTH, Greg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Alarm 2 2
playing wma files 2
Macro to Play Wave File 3
Playing wavfiles from excel 3
sound 4
Playing a sequence of WAV files 6
Run-time error question 0
Assign a sound to a variable 19

Top