Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Simple Sound Macro


I am hoping someone can help, this shoudn't be a difficult problem...

I currently have a macro that looks like this:

Sub Error_1()
Application.ScreenUpdating = False
Range("F6").Select
Selection.Font.ColorIndex = 36
Range("A1").Select
Application.ScreenUpdating = True
End Sub

All it is doing it unhiding a character in the relevant cell, what i am
looking for is some code that will add a noise to this action. the
noise will be in .WMV format so i believe will be easy to add.

Any ideas?


--
chalky
------------------------------------------------------------------------
chalky's Profile: http://www.excelforum.com/member.php...o&userid=23758
View this thread: http://www.excelforum.com/showthread...hreadid=501011

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Simple Sound Macro

Try:

Range("A1").Speak

--
Gary''s Student


"chalky" wrote:


I am hoping someone can help, this shoudn't be a difficult problem...

I currently have a macro that looks like this:

Sub Error_1()
Application.ScreenUpdating = False
Range("F6").Select
Selection.Font.ColorIndex = 36
Range("A1").Select
Application.ScreenUpdating = True
End Sub

All it is doing it unhiding a character in the relevant cell, what i am
looking for is some code that will add a noise to this action. the
noise will be in .WMV format so i believe will be easy to add.

Any ideas?


--
chalky
------------------------------------------------------------------------
chalky's Profile: http://www.excelforum.com/member.php...o&userid=23758
View this thread: http://www.excelforum.com/showthread...hreadid=501011


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Simple Sound Macro


Thanks for this. The sound i had planned would actually be stored on
the hard drive, i need the programming to actually play this sound file
as the Macro runs


--
chalky
------------------------------------------------------------------------
chalky's Profile: http://www.excelforum.com/member.php...o&userid=23758
View this thread: http://www.excelforum.com/showthread...hreadid=501011

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default Simple Sound Macro


from:
http://www.exceltip.com/st/Playing_W...osoft_Excel/46
0.html
It's easy to play soundfiles in WAV-format. You only need to know the
filename of the sound you want to play, and decide if you want the macro to
wait while the sound plays or not.

Here is an example:
Public Declare Function sndPlaySound Lib "winmm.dll" _
Alias "sndPlaySoundA" (ByVal lpszSoundName As String, _
ByVal uFlags As Long) As Long

Sub PlayWavFile(WavFileName As String, Wait As Boolean)
If Dir(WavFileName) = "" Then Exit Sub ' no file to play
If Wait Then ' play sound before running any more code
sndPlaySound WavFileName, 0
Else ' play sound while code is running
sndPlaySound WavFileName, 1
End If
End Sub

Sub TestPlayWavFile()
PlayWavFile "c:\foldername\soundfilename.wav", False
MsgBox "This is visible while the sound is playing..."
PlayWavFile "c:\foldername\soundfilename.wav", True
MsgBox "This is visible after the sound is finished playing..."
End Sub




"chalky" wrote in
message ...

Thanks for this. The sound i had planned would actually be stored on
the hard drive, i need the programming to actually play this sound file
as the Macro runs


--
chalky
------------------------------------------------------------------------
chalky's Profile:

http://www.excelforum.com/member.php...o&userid=23758
View this thread: http://www.excelforum.com/showthread...hreadid=501011



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Simple Sound Macro


Ah that looks like it should nail it.

Thanks!


--
chalky
------------------------------------------------------------------------
chalky's Profile: http://www.excelforum.com/member.php...o&userid=23758
View this thread: http://www.excelforum.com/showthread...hreadid=501011

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
How can I add sound to a macro button in excel? KCSA Excel Discussion (Misc queries) 2 October 15th 09 08:56 PM
Help with simple macro Sam Commar Excel Discussion (Misc queries) 3 April 15th 08 04:30 PM
playing a sound in a macro Kelly 1st Excel Programming 5 November 28th 05 12:30 PM
Sound when running macro GJones Excel Programming 0 August 18th 04 06:41 PM
How can I make a sound alert using macro in Excel! (But not use speaker) bookworm98 Excel Programming 5 December 11th 03 08:49 AM


All times are GMT +1. The time now is 07:09 PM.

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"