mewingpants
New Member
- Joined
- Apr 1, 2019
- Messages
- 12
So currently I am using this soundme code to play a .wav file
Then I use this code to play the siren.wav if E15 is greater than 146772
This all works great, the siren plays if E15 is greater than the value.
What I would like to do if possible is, have a "Acknowledge" button that will quit playing the siren.wav
This is just so whoever is putting in a value that exceeds E15 the siren goes off and they have to manually 'ack' the alarm by pressing the button.
Sorry if this has been asked before but I have searched this forum and googled this, I couldn't find anything that was as specific as to what I would like it to do.
*note* the siren wav is not looped but it is rather long siren on purpose @ 15 seconds, so it does stop on its own. This is just so the user will see their problem and try to correct it.
Version: MS for Office 365 32-bit
Code:
#If Win64 Then Private Declare PtrSafe Function PlaySound Lib "winmm.dll" _
Alias "PlaySoundA" (ByVal lpszName As String, _
ByVal hModule As LongPtr, ByVal dwFlags As Long) As Boolean
[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=Else]#Else[/URL]
Private Declare Function PlaySound Lib "winmm.dll" _
Alias "PlaySoundA" (ByVal lpszName As String, _
ByVal hModule As Long, ByVal dwFlags As Long) As Boolean
[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=End]#End[/URL] If
Const SND_SYNC = &H0
Const SND_ASYNC = &H1
Const SND_FILENAME = &H20000
Function SoundMe() As String
'Updateby Extendoffice 20161223
Call PlaySound("siren.wav", _
0, SND_ASYNC Or SND_FILENAME)
SoundMe = ""
End Function
Then I use this code to play the siren.wav if E15 is greater than 146772
Code:
=IF(E15>146772,SoundMe(),"")
This all works great, the siren plays if E15 is greater than the value.
What I would like to do if possible is, have a "Acknowledge" button that will quit playing the siren.wav
This is just so whoever is putting in a value that exceeds E15 the siren goes off and they have to manually 'ack' the alarm by pressing the button.
Sorry if this has been asked before but I have searched this forum and googled this, I couldn't find anything that was as specific as to what I would like it to do.
*note* the siren wav is not looped but it is rather long siren on purpose @ 15 seconds, so it does stop on its own. This is just so the user will see their problem and try to correct it.
Version: MS for Office 365 32-bit