Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Excel 2010
I have an earlier post related to this one. I am trying to set-up an audible alarm when a cell has a value greater than 0. I was using this VBA for my alarm function: 'Windows API function declaration Private Declare Function PlaySound Lib "winmm.dll" _ Alias "PlaySoundA" (ByVal lpszName As String, _ ByVal hModule As Long, ByVal dwFlags As Long) As Long Function Alarm(Cell, Condition) Dim WAVFile As String Const SND_ASYNC = &H1 Const SND_FILENAME = &H20000 On Error GoTo ErrHandler If Evaluate(Cell.Value & Condition) Then WAVFile = ThisWorkbook.Path & "\sound.wav" 'Edit this statement Call PlaySound(WAVFile, 0&, SND_SYNC Or SND_FILENAME) Alarm = True Exit Function End If ErrHandler: Alarm = False End Function It worked at one time but now I get #NAME? in the cell that I use the function. Can you help me troubleshoot this error ? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Alarm | Excel Worksheet Functions | |||
How to set an alarm in excel... | Excel Discussion (Misc queries) | |||
Recalc Alarm | Excel Programming | |||
Alarm Timer | Excel Programming | |||
Alarm | Excel Programming |