+ Reply to Thread
Results 1 to 8 of 8

Excel 2007 : Code to play wav file.

  1. #1
    Forum Contributor
    Join Date
    10-08-2010
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    386

    Code to play wav file.

    Ok i have done alot of research today, and i tried 3 or 4 different codes and none of them have worked. sometimes i get a compilation error and others just execute the macro as if the code wasn't even there.

    here is the setup:

    i have a control button on a sheet that when clicked shows a userform, that asks for tag id and qty. this updates another sheet and when its done shows another user form with a success message. when this message pops up i would like it to play a wav file (its from borat when he says GREAT SUCCESS!)

    any ideas on how to get a wav file to play from a user form control?

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Code to play wav file.

    In this thread I showed an OP how to play some sounds on button clicks, much the same as a userform. Take a look:

    http://www.excelforum.com/excel-gene...m-tasks.html#5
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    10-08-2010
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    386

    Re: Code to play wav file.

    ok it allowed me to play the tada sound, but i put the "GreatSuccess.wav" file in the media folder, and then changed tada to greatsuccess but it doesn't play it.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Code to play wav file.

    Only thing I can think of is you found the wrong media folder...?

  5. #5
    Forum Contributor
    Join Date
    10-08-2010
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    386

    Re: Code to play wav file.

    c:\WINDOWS\MEDIA

    oh well... it was a dream, but i guess now that dream is dead.

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Code to play wav file.

    Backup the TADA.wav file somewhere else, then remove it from the media folder.

    Rename your desired sound file as TADA.wav and put in that folder. That could do it.

  7. #7
    Forum Contributor
    Join Date
    10-08-2010
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    386

    Re: Code to play wav file.

    yea i already tried that before i replied. didn't work EXCEPT i didn't backup the tada file. haha..

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Code to play wav file.

    Well, if it was playing the tada file and then you replaced the tada file with something else also named tada but it didn't play that, then you've got something going on in your OS.

+ 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