+ Reply to Thread
Results 1 to 3 of 3

Help:in editing code

Hybrid View

  1. #1
    Registered User
    Join Date
    03-12-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    2

    Help:in editing code

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

    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

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Help:in editing code

    Function Alarm(cell, Condition)
        If Evaluate(cell.Value & Condition) Then
            msgbox "Bad"
            Alarm = True
        Else
            msgbox "Good"
            Alarm = False
        End If
    End Function
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    03-12-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Help:in editing code

    Thanks Patel45
    can I call picture file to show up?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1