+ Reply to Thread
Results 1 to 6 of 6

excel to play sound file

  1. #1
    Registered User
    Join Date
    11-03-2006
    Posts
    5

    excel to play sound file

    I'm a VBA idiot, really. I want to have excel play a sound when a cell reaches a certain value. I've seen links to j-walk.com, but I'm such a rookie, I can't even get that to work. Anyone want to give me the VBA "play-by-play", not just the link.

    Thanks.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,475
    insert a .wav file into your sheet
    you can even create a .wav file by going to insert object, select creat or from file, if you select from file the find the file and insert it, if you have a mic then select create wavefile and you will be taken to a record window hit record and talk into to mic.

    there will now be an object in the page, doubleclick on the object to here the sound.

    hit the macro recorder and then double click on the object to hear the sound.
    turn off the recorder, now you have the code to run the macro

    now in the worksheet module insert the code into a worksheet_change event, so that when the value is what you want make the sound

    Please Login or Register  to view this content.
    good luck...

  3. #3
    Registered User
    Join Date
    11-03-2006
    Posts
    5

    You're giving me too much credit

    I inserted the *.wav file, but that's about it. I have no idea how (after cutting and pasting the code) to get it to run. I get a bunch of VBA errors. What gives ???

  4. #4
    Registered User
    Join Date
    11-03-2006
    Posts
    5

    Losing patience

    Here's my macro:

    Sub Macro2()
    '
    ' Macro2 Macro
    ' Macro recorded 11/3/2006 by
    '
    ' Keyboard Shortcut: Ctrl+x
    '
    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address = ("$d$33") Then
    If Target.Value = 1 Then
    ActiveSheet.Shapes("Object 10").Select
    Selection.Verb Verb:=xlPrimary

    End If
    End If

    End Sub




    And here's the error:

    Compile error:
    Expected End Sub

  5. #5
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,475
    http://www.contextures.com/xlvba01.html#Workbook

    go to the above site to find the worksheet module

  6. #6
    Registered User
    Join Date
    11-03-2006
    Posts
    5

    Thanks Dave M

    I got it. Although I'm not really sure how. I'll have to do that a couple thousand more times to get familiar.

    Thanks

+ 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