Play Sound Vba Excel. Here is an example. This soundnote kan be played back by opening the dialog for editing of cell notes.
By george lungu in order to create sound effects in excel models we need to download various sound files off the internet store them preferably in the same directory with the excel file and have a vba script access and play them when certain logic conditions in the worksheet or in other vba macros occur. Click insert module and paste the following code in the module window. Using beep will not allow you to play any sound but it will make an audible sound and does not require an api call or the computer to have the specified audio file.
Sub playbackgroundsoundfile my computer audio play c waterfall wav audioplaymode waittocomplete end sub.
You only need to know the filename of the sound you want to play and decide if you want the macro to wait while the sound plays or not. Playing wav files using vba in microsoft excel. Playing sounds in excel using vba 1. To play one of these sounds select the cell in either column a or b and execute the following code.