This will play MP3's on your PC, using the Windows Media Player automatically. Just change the file name of the MP3 you want to play and change the Folder that file is in, in the code below. Add this part of the code to a Standard code module, like: Module1!
You just need to add the OnTime timer code at the bottom, must be placed in the "ThisWorkbook" code module!
Note: The Workbook must be open for this to work. I do not know if some "Screen Savers" will stop the OnTime Event?
Private Declare Function ShellExecute _
Lib "shell32.dll" Alias "ShellExecuteA" ( _
ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Declare Function FindWindow _
Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Sub myMP3Play()
'Standard Module Code, like: Module1!
Dim thisFolder$, MediaPlayer$, theFile$
theFile = "Q3.mp3"
thisFolder = "C:\Program Files\Windows Media Player\"
'Hide MediaPlayer and play!
'Call ShellExecute(FindWindow("xlMain", vbNullString), _
' "Open", theFile, vbNullString, thisFolder, 0)
'Minimize MediaPlayer and play!
'Call ShellExecute(FindWindow("xlMain", vbNullString), _
' "Open", theFile, vbNullString, thisFolder, 2)
'Show MediaPlayer and play!
Call ShellExecute(FindWindow("xlMain", vbNullString), _
"Open", theFile, vbNullString, thisFolder, 1)
End Sub
Private Sub Workbook_Open()
'ThisWorkbook code, Only!
'At 6:00 AM each day run my code!
Application.OnTime TimeValue("06:00:00"), "myMP3Play"
End Sub