Jaafar Tribak
Well-known Member
- Joined
- Dec 5, 2002
- Messages
- 9,806
- Office Version
- 2016
- Platform
- Windows
Hi,
This works:
This doesn't work as it doesn't store the media player in a module level variable.
.OpenPlayer "C:\test\Alarm02.wav" Method works but it shows the media player window unlike the URL Property... This is similar to what happens when opening a new excel instance (late bound) without setting the Visible Property to TRUE.
Is there some MPlayer Method or Property that can be set (or some other workaround) to make the test2 macro work - ie:= w/o storing the MPlayer instance in a module level variable and w/o making it visible ?
Regards.
This works:
VBA Code:
Dim oMPlayer As Object
Sub test1()
Set oMPlayer = CreateObject("New:{6BF52A52-394A-11D3-B153-00C04F79FAA6}")
With oMPlayer
.URL = "C:\test\Alarm02.wav"
Debug.Print .currentMedia.Name
End With
End Sub
This doesn't work as it doesn't store the media player in a module level variable.
VBA Code:
Sub test2()
With CreateObject("New:{6BF52A52-394A-11D3-B153-00C04F79FAA6}")
.URL = "C:\test\Alarm02.wav"
Debug.Print .currentMedia.Name
End With
End Sub
.OpenPlayer "C:\test\Alarm02.wav" Method works but it shows the media player window unlike the URL Property... This is similar to what happens when opening a new excel instance (late bound) without setting the Visible Property to TRUE.
Is there some MPlayer Method or Property that can be set (or some other workaround) to make the test2 macro work - ie:= w/o storing the MPlayer instance in a module level variable and w/o making it visible ?
Regards.