While providing some help from another user on here I came across the following code which will play a .wav file from VBA without launching any third party apps (like winamp or windoze media player):
And it works well.Please Login or Register to view this content.
However, I'd like to embed the wav files in question into my workbook and play them from there without having to make a user download them as separate files. So....I looked around and found the following:
Insert > Object... > Create from File > C:\Folder\filename.WAV
and then play it by either:
orPlease Login or Register to view this content.
The problem with both the methods of playing the embedded file is that it will try to launch the systems default .wav file player. This means the user will get a message saying "Do you want to open this" and if the default wav player is winamp and (like mine) is set to repeat the playlist, the wav isn't just played once.Please Login or Register to view this content.
Is there any way to combine to two methods above? ie, have the .wav file embedded in a workbook but play it using the "sndPlaySound" method which doesn't launch an external .wav player?
I've tried replacing the file location with activesheet.shapes("object 1") but get a "doesn't support this method" error.
Bookmarks