Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
al al is offline
external usenet poster
 
Posts: 363
Default Need macro to play sound in Excel 2007

When a user button is pushed, how to I play a sound clip (like a wav file)?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Need macro to play sound in Excel 2007

Assign the button to something like:

Sub Macro1()
x = Shell("cmd.exe /c C:\destiny.wav", 1)
End Sub
--
Gary''s Student - gsnu200848


"AL" wrote:

When a user button is pushed, how to I play a sound clip (like a wav file)?

  #3   Report Post  
Posted to microsoft.public.excel.programming
al al is offline
external usenet poster
 
Posts: 363
Default Need macro to play sound in Excel 2007

Thanks for responding. Unless I did something wrong, this did not work. I
created a form with a single button. The button click performed your
recommended code. I replaced "destiny.wav" with my own wav file but it still
did not work. Again, thanks.

AL



"Gary''s Student" wrote:

Assign the button to something like:

Sub Macro1()
x = Shell("cmd.exe /c C:\destiny.wav", 1)
End Sub
--
Gary''s Student - gsnu200848


"AL" wrote:

When a user button is pushed, how to I play a sound clip (like a wav file)?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Need macro to play sound in Excel 2007

Be sure the .wav is in C:\
--
Gary''s Student - gsnu200848


"AL" wrote:

Thanks for responding. Unless I did something wrong, this did not work. I
created a form with a single button. The button click performed your
recommended code. I replaced "destiny.wav" with my own wav file but it still
did not work. Again, thanks.

AL



"Gary''s Student" wrote:

Assign the button to something like:

Sub Macro1()
x = Shell("cmd.exe /c C:\destiny.wav", 1)
End Sub
--
Gary''s Student - gsnu200848


"AL" wrote:

When a user button is pushed, how to I play a sound clip (like a wav file)?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 143
Default Need macro to play sound in Excel 2007

maybe better not use shell

Declare Function sndPlaySound32 Lib "winmm.dll" Alias "sndPlaySoundA" _
(ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

Sub SoundWarning()
sndPlaySound32 "c:\windows\media\tada.wav", 0
End Sub

"AL" wrote in message
...
| Thanks for responding. Unless I did something wrong, this did not work.
I
| created a form with a single button. The button click performed your
| recommended code. I replaced "destiny.wav" with my own wav file but it
still
| did not work. Again, thanks.
|
| AL
|
|
|
| "Gary''s Student" wrote:
|
| Assign the button to something like:
|
| Sub Macro1()
| x = Shell("cmd.exe /c C:\destiny.wav", 1)
| End Sub
| --
| Gary''s Student - gsnu200848
|
|
| "AL" wrote:
|
| When a user button is pushed, how to I play a sound clip (like a wav
file)?



  #6   Report Post  
Posted to microsoft.public.excel.programming
al al is offline
external usenet poster
 
Posts: 363
Default Need macro to play sound in Excel 2007

Homey:
That worked. Thank you for sharing.

AL



"Homey" wrote:

maybe better not use shell

Declare Function sndPlaySound32 Lib "winmm.dll" Alias "sndPlaySoundA" _
(ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

Sub SoundWarning()
sndPlaySound32 "c:\windows\media\tada.wav", 0
End Sub

"AL" wrote in message
...
| Thanks for responding. Unless I did something wrong, this did not work.
I
| created a form with a single button. The button click performed your
| recommended code. I replaced "destiny.wav" with my own wav file but it
still
| did not work. Again, thanks.
|
| AL
|
|
|
| "Gary''s Student" wrote:
|
| Assign the button to something like:
|
| Sub Macro1()
| x = Shell("cmd.exe /c C:\destiny.wav", 1)
| End Sub
| --
| Gary''s Student - gsnu200848
|
|
| "AL" wrote:
|
| When a user button is pushed, how to I play a sound clip (like a wav
file)?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
play sound when closing xcel 2007 Pirgnori Excel Discussion (Misc queries) 1 December 28th 09 09:21 PM
Play sound aac Excel Discussion (Misc queries) 2 December 5th 07 11:24 PM
Play Sound File Soniya[_4_] Excel Programming 0 February 22nd 06 10:46 AM
HOW TO PLAY SOUND.WAV FILES SIMULTANEOUSLY UNDER EXCEL Hotbird[_4_] Excel Programming 3 January 28th 05 03:16 PM


All times are GMT +1. The time now is 07:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"