Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there a way to write a code in an excel file that will enable me to
play some music (on windows media player etc) and after the piece is played, return me back to excel? Thanks, Naveen |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" _
(ByVal lpszName As String, _ hModule As Long, _ ByVal dwFlags As Long) As Long '----------------------------------------------------------------- Public Function PlayWavFile(WavFile As String) As String '----------------------------------------------------------------- Const SND_ASYNC = &H1 Const SND_FILENAME = &H20000 PlaySound WavFile, 0, SND_ASYNC Or SND_FILENAME PlayWavFile = "" End Function -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Naveen Sukhramani" wrote in message om... Is there a way to write a code in an excel file that will enable me to play some music (on windows media player etc) and after the piece is played, return me back to excel? Thanks, Naveen |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here is one I use in a double_click event to play the highlighted title
where the full file name is in col E and I am clicking any column. Also, look at the other one Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) If Target.Row = 4 Then Range("a5:g" & Range("a65536").End(xlUp).Row) _ ..Sort Key1:=Cells(5, ActiveCell.Column), Order1:=xlAscending, Orientation:=xlTopToBottom Cells(5, Target.Column).Select End If mc = Cells(ActiveCell.Row, "e") If Target.Row 4 Then x = Right(Application.OperatingSystem, 4) If x < 5 Then cmd = "Start " & Chr(34) & mc & Chr(34) Shell cmd 'works with xl97 Else Dim FullFileName As String FullFileName = mc ActiveWorkbook.FollowHyperlink Address:=FullFileName End If End If End Sub ====== This might be easier for you. Sub playselections() For Each C In Selection mc = Cells(C.Row, "e") x = Right(Application.OperatingSystem, 4) If x < 5 Then cmd = "Start " & Chr(34) & mc & Chr(34) Shell cmd 'works with xl97 Else Dim FullFileName As String FullFileName = mc ActiveWorkbook.FollowHyperlink Address:=FullFileName End If Next End Sub -- Don Guillett SalesAid Software "Naveen Sukhramani" wrote in message om... Is there a way to write a code in an excel file that will enable me to play some music (on windows media player etc) and after the piece is played, return me back to excel? Thanks, Naveen |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Detecting the actual playing or NOT playing of a WAV file | Excel Discussion (Misc queries) | |||
Games not playing in Excel | Excel Discussion (Misc queries) | |||
music | New Users to Excel | |||
Playing a .wav when a cell's value changes | Excel Programming | |||
Excel XP x Playing Sounds | Excel Programming |