Consulting

Results 1 to 5 of 5

Thread: Need audio player to be embedded in form

  1. #1
    VBAX Regular
    Joined
    Mar 2009
    Posts
    47
    Location

    Need audio player to be embedded in form

    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

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    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]

  3. #3
    VBAX Regular
    Joined
    Mar 2009
    Posts
    47
    Location
    Thanks. Will try and let you know.

  4. #4
    VBAX Regular
    Joined
    Mar 2009
    Posts
    47
    Location
    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.

  5. #5

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •