rajkumar
09-18-2008, 05:03 PM
Hi Experts,
How to play midi files from vba? i tried one from j-walk web site but received an error
file:///C:/DOCUME%7E1/ycvf878f/LOCALS%7E1/Temp/moz-screenshot.jpg"The specified device is not open or not recognized by MCI"
the code i used is
Private Declare Function mciExecute Lib "winmm.dll" _
(ByVal lpstrCommand As String) As Long
Sub PlayMIDI()
MIDIFile = "Mission_Impossible.mid"
MIDIFile = "D:\Profiles\YCVF878F\My Documents\My Music\Midi" & "\" & MIDIFile
mciExecute ("play " & MIDIFile)
End Sub
Sub StopMIDI()
MIDIFile = "Mission_Impossible.mid"
MIDIFile = "D:\Profiles\YCVF878F\My Documents\My Music\Midi" & "\" & MIDIFile
mciExecute ("stop " & MIDIFile)
End Sub
Any help is greatful
Raj
How to play midi files from vba? i tried one from j-walk web site but received an error
file:///C:/DOCUME%7E1/ycvf878f/LOCALS%7E1/Temp/moz-screenshot.jpg"The specified device is not open or not recognized by MCI"
the code i used is
Private Declare Function mciExecute Lib "winmm.dll" _
(ByVal lpstrCommand As String) As Long
Sub PlayMIDI()
MIDIFile = "Mission_Impossible.mid"
MIDIFile = "D:\Profiles\YCVF878F\My Documents\My Music\Midi" & "\" & MIDIFile
mciExecute ("play " & MIDIFile)
End Sub
Sub StopMIDI()
MIDIFile = "Mission_Impossible.mid"
MIDIFile = "D:\Profiles\YCVF878F\My Documents\My Music\Midi" & "\" & MIDIFile
mciExecute ("stop " & MIDIFile)
End Sub
Any help is greatful
Raj