VBA - play audio file click button

martin_j_king

New Member
Joined
Jan 28, 2011
Messages
20
Hi,

I have a language xls which has two columns; english word - spanish word
I would like to go through and have a button on each row that when you click it, plays a recorded audio file.
I thought it would be simple but struggling, have tried a few other forums and tried the code but doesn't seem to work

Anybody have any suggestions? Are there any free plugins that assist?

thanks,
Martin
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Thanks for that, the code works great when I want a specific file.

However, I have around 100 files.

What I would like the macro to do is;

in column C, row 2 - 100, there is a list of file names. e.g. test.wav

When the user selects one of these cells, eg Cell C2, text value "test.wav", and clicks the button, it recognises the active / selected cell is c2, reads the test.wav and picks this file from the folder

so assume it is this line of the code that needs to be changed;
WAVFile = "dogbark.wav"

 
Upvote 0

Forum statistics

Threads
1,224,603
Messages
6,179,849
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top