View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Rob van Gelder[_4_] Rob van Gelder[_4_] is offline
external usenet poster
 
Posts: 1,236
Default Excel sound alert_new task


Using the OnTime procedure and an adaption of John's PlaySound.

Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal
lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long

Sub testit()
Const SND_ASYNC = &H1
Const SND_FILENAME = &H20000

Application.OnTime Now() + 1 / 24 / 60, "testit"

With Sheet1
If Range("A1").Value = 12 And Range("B1").Value = 15 Or _
Range("A1").Value = 13 And Range("B1").Value = 17 Or _
Range("A1").Value = 15 And Range("B1").Value = 54 Or _
Range("A1").Value = 15 And Range("B1").Value = 22 Or _
Range("A1").Value = 18 And Range("B1").Value = 15 Then
PlaySound ThisWorkbook.Path & "\chimes.wav", 0, SND_ASYNC Or
SND_FILENAME
End If
End With
End Sub


Rob


"___Zoom" wrote in message
...
Dear Ron,
I am having difficulties on implementing this Excel sound alert function

to
an XL application of mine. In my problem, I want to trigger the sound file
depending on the content of two cells (Sheet1's A1 and B1: which should

have
10 suitable pairs for triggering). Furthermore, I want to bound the

process
of checking these cells content to a automatic check of system time of my
PC. The system clocked should be checked every munite and if the

conditions
are met for Sheet1 A1 and Sheet1 B1 then the sound file be played. Can
anyone help me with this please?
I can get into more detail if you or any other group member is

interested...

"Ron de Bruin" wrote in message
...
Try John's Sound example Michelle
http://www.j-walk.com/ss/excel/tips/charts.htm

http://www.j-walk.com/ss/excel/tips/tip87.htm
Playing a Sound Based on a Cell's Value

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Michelle" wrote in message

...
How can I create an audible alert sound in an excel
spreadsheet. For instance, if column B falls below the
sume in column A, I want an alert (sound) or pop-up to
automatically notify me.

Have a Happy New Year!

Thanks
Michelle