I need an audio player applet (with play, stop, pause, rewind buttons and position slider) to be embedded in a form in VBA.
Is there a ready-made solution available such as Active-X or Java? Thanks.
Shankar
I need an audio player applet (with play, stop, pause, rewind buttons and position slider) to be embedded in a form in VBA.
Is there a ready-made solution available such as Active-X or Java? Thanks.
Shankar
Since most will have Windows MediaPlayer, use that.
e.g. Replace WAV file with yours.
[vba]Private Sub UserForm_Initialize()
Dim newMedia
With WindowsMediaPlayer1
.settings.requestMediaAccessRights ("full")
'open up playlist called excel
.playlistCollection.getByName ("Excel")
'make sure playlist is empty
.currentPlaylist.Clear
'add the first file to play
Set newMedia = .newMedia("c:\myfiles\excel\sound\boooo.wav")
.currentPlaylist.insertItem 0, newMedia
'start playing
.Controls.Play
End With
End Sub[/vba]
Thanks. Will try and let you know.
I didn't realize that WMP was in the 'additional controls' of the form toolbox.
However when I try to drag the WMP from the toolbox to my form, Excel crashes.
I tried with Word, it crashes too.
I have Office 2010 installed and am running it under Windows 7.
Trying to figure out the reason it is crashing.
To resolve wmp errors, see: http://www.updatexp.com/wmpdll.html
or
http://social.answers.microsoft.com/...0-acad3a695798