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
|