Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
play sound when closing xcel 2007 | Excel Discussion (Misc queries) | |||
Play sound | Excel Discussion (Misc queries) | |||
Play Sound File | Excel Programming | |||
HOW TO PLAY SOUND.WAV FILES SIMULTANEOUSLY UNDER EXCEL | Excel Programming |