Excel sound alert

  • Thread starter Thread starter Michelle
  • Start date Start date
M

Michelle

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
 
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...
 
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
 
Thanks for your answer Rob,
I have spend some time trying to adopt a solution myself too. I have a
detailed description of the situation in my message with the message info
as:
----------------------------------------------------------
From: "___Zoom" <[email protected]>
References: <[email protected]>
<u#[email protected]>
<#[email protected]>
<#[email protected]>
Subject: Re: Excel sound alert problem
Date: Sat, 3 Jan 2004 10:46:13 +0200
Lines: 197
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
Message-ID: <#[email protected]>
Newsgroups: microsoft.public.excel.programming
NNTP-Posting-Host: 82.145.234.203
Path: TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
Xref: TK2MSFTNGP08.phx.gbl microsoft.public.excel.programming:452897
----------------------------------------------------------------------------
 
Back
Top