Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default speech with if formula

I want to assign audio file to a cell , to be triggered when the cell value
is grater than 15 for example
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default speech with if formula

http://support.microsoft.com/default...kb;en-us;86281
How To Play a Waveform (.WAV) Sound File in Visual Basic

Choose your event (probably the Calculation event)
http://www.cpearson.com/excel/events.htm

Use a static variable or two to keep track of when to play and when you have
played the sound.

--
Regards,
Tom Ogilvy



"Mike" wrote in message
...
I want to assign audio file to a cell , to be triggered when the cell

value
is grater than 15 for example



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 284
Default speech with if formula

Mike,

Depending on the version of Windows you're running the Excel file under,
there may be different approaches. Either way, take a look at the reference
to Chip Pearson's discussion on events given in Tom's post above.

This example checks to see if cell C1 increased to 15 or greater after
calculation and plays the referenced wav file if that is the case:

_ _ _ _ _ _ _ _ _ _

Private Sub Worksheet_Calculate()
Dim strWavPath As String
If Range("$C$1").Value = 15 Then
strWavPath = "C:\Program Files\Windows NT\Pinball\SOUND108.wav"
x = Shell("sndrec32 /play /close " & Chr(34) & strWavPath & Chr(34),
vbHide)
End If
End Sub

_ _ _ _ _ _ _ _ _ _

If you know the OS will be WindowsXP you could use the sub below although
the Windows text to speech lacks a bit in diction:

_ _ _ _ _ _ _ _ _ _

Private Sub Worksheet_Calculate()
Dim strNotify As String
If Range("$C$1").Value = 15 Then
strNotify = "The value of C 1 is " & CStr(Range("$C$1").Value)
Set objVoice = CreateObject("SAPI.SpVoice")
objVoice.Speak strNotify
End If
End Sub
_ _ _ _ _ _ _ _ _ _


Steve Yandl

"Mike" wrote in message
...
I want to assign audio file to a cell , to be triggered when the cell value
is grater than 15 for example



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
speech recognition cjaynes Excel Discussion (Misc queries) 3 March 11th 06 01:41 AM
Speech Therapy BillCPA Excel Discussion (Misc queries) 0 January 11th 06 03:15 PM
Text to speech PCOR Excel Programming 2 October 19th 05 03:16 AM
Getting Speech to work Mark H Excel Worksheet Functions 0 November 4th 04 08:32 PM
Application.Speech MTBer[_3_] Excel Programming 2 June 16th 04 11:23 AM


All times are GMT +1. The time now is 12:07 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"