I want to create two buttons in a sheet (Play and Pause). If I press Play(or Pause) button, a sound will play (or Pause). The path of sound was stolen in A1. How can I do?
Make a commandbutton on your sheet. Dubble click and add this code
Code:Private Sub CommandButton1_Click() Select Case CommandButton1.Caption Case "Start" CommandButton1.Caption = "Pause" 'PlaySoundFile "C:\Pause.wav" Case "Pause" CommandButton1.Caption = "Play" 'PlaySoundFile "C:\Play.wav" Case Else ' If not initialized properly CommandButton1.Caption = "Play" End Select End Sub
Last edited by rwgrietveld; 07-13-2009 at 05:16 AM.
Looking for great solutions but hate waiting?
Seach this Forum through Google
www.Google.com (e.g. +multiple +IF site:excelforum.com/excel-general/ )
www.Google.com (e.g. +fill +combobox site:excelforum.com/excel-programming/ )
Ave,
Ricardo
No. I want to run a sound not change caption of button
Different approach. See the attachement:
Last edited by rwgrietveld; 07-13-2009 at 08:46 AM.
Looking for great solutions but hate waiting?
Seach this Forum through Google
www.Google.com (e.g. +multiple +IF site:excelforum.com/excel-general/ )
www.Google.com (e.g. +fill +combobox site:excelforum.com/excel-programming/ )
Ave,
Ricardo
Thank you very much. But how to pause a sound.
Last edited by nguyennb; 07-14-2009 at 05:56 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks