Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50158

Help:in editing code

$
0
0
Hi
Is it possible to have picture to replace the sound file in this code below. Any ideas please?

Code:

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 & "\left.wav" 'Edit this statement
        Call PlaySound(WAVFile, 0&, SND_ASYNC Or SND_FILENAME)
        Alarm = True
    Else: WAVFile = ThisWorkbook.Path & "\right.wav" 'Edit this statement
        Call PlaySound(WAVFile, 0&, SND_ASYNC Or SND_FILENAME)
        Exit Function
    End If
ErrHandler:
    Alarm = False
End Function


Viewing all articles
Browse latest Browse all 50158

Trending Articles