I'm trying to populate an Excel worksheet with controls that will play audio file examples of how to pronunce a list of words.
If the content of A1 is "introduce", I want Excel to play an audio file named introduce.m4a when (say) a button in B1 is pressed. I don't want the sound played by an external app or another browser window.
I've found a fair bit of VBA code that plays a sound triggered by events in an Excel worksheet, but none that gets the name of the audio file from a cell in the sheet.
Sub Playm4a() Application.ScreenUpdating = False On Error Resume Next ActiveSheet.OLEObjects.Add(Filename:=ActiveCell.Text, Link:=True).Select If Err.Number <> 0 Then Application.ScreenUpdating = True MsgBox "Could not play " & ActiveCell.Text Exit Sub End If Selection.Verb Selection.Delete End Sub
Thanks in advance for any help!