From: ZipCurs on
I have be working to get the Media Player to run small sections of longer
audio and video clips. I am having some success, but have hit a number of
dead ends and was hoping to get some help.

Working in Excel 2007 on an XP machine, the following code works great for
an object using the Media Player (msdxm.ocx) on a UserForm. The object is
not recognized on a Vista machine, and nothing similar can be replaced. Even
though I can see the msdxm.ocx file in the actual directory, this option is
not available under References. What are my options to get this to run on
multiple machines? Can I get the msdxm.ocx version to show up on the
Reference Library with Vista? I can see the commands on the Object Browser
on the Vista machine, I just don't know how to insert a "Media Player"
instead of a "Windows Media Player". Putting the "Media Player" on a
worksheet works on the XP machine until the file is closed. Upon opening, it
crashes Excel and won't run again.

Private Sub TryIt()
'Runs msdxm.ocx ActiveX object on UserForm1. It actually seems to work.
Dim MediaFileName As String
MediaFileName = Range("B2")

Application.EnableEvents = True

Load UserForm1
UserForm1.MediaPlayer1.AutoStart = False
UserForm1.MediaPlayer1.Filename = MediaFileName
UserForm1.MediaPlayer1.ShowTracker = True
UserForm1.MediaPlayer1.ShowStatusBar = True
UserForm1.MediaPlayer1.SelectionStart = Range("B3")
UserForm1.MediaPlayer1.SelectionEnd = Range("B4")
UserForm1.MediaPlayer1.Play
UserForm1.Show
Unload UserForm1
End Sub


Using the ActiveX object which references wmp.dll on a UserForm works on
both the XP and Vista machine. I can set the starting point, but have no
clue how to stop it at the desired point. Is there a way to monitor the
current location of the media playing and stop it? Is there some tricky way
the set SelectionEnd with this object? I am guessing that I will need to
have my own controls to get this to behave.

Sub TryIt()
'Runs wmp.dll ActiveX object on UserForm1. The start sort of works, but
no end.
Dim MyStart As Long
Dim MyEnd As Long
Dim MyStringStart As String
Dim MyFile As String

MyFile = Range("B2")
MyStart = Range("B3")
MyEnd = Range("B4")

Application.EnableEvents = True
Load UserForm1
UserForm1.Caption = "Time 1 - Time 2"
UserForm1.WindowsMediaPlayer1.settings.autoStart = False

UserForm1.WindowsMediaPlayer1.URL = MyFile
UserForm1.WindowsMediaPlayer1.Controls.currentPosition = MyStart
UserForm1.WindowsMediaPlayer1.Controls.Play
UserForm1.Show
Unload UserForm1
End Sub

I am open to other options. Any help is more than appreciated. Thanks
Zipcurs
From: joel on

Have you tried the DLL msdxmlc.dll?


I see you are using the objectborowser like I suggested.


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/showthread.php?t=178891

[url="http://www.thecodecage.com"]Microsoft Office Help[/url]

From: Jef Gorbach on
On Feb 12, 11:43 am, ZipCurs <ZipC...(a)discussions.microsoft.com>
wrote:
> I have be working to get the Media Player to run small sections of longer
> audio and video clips.  I am having some success, but have hit a number of
> dead ends and was hoping to get some help.
>
> Working in Excel 2007 on an XP machine, the following code works great for
> an object using the Media Player (msdxm.ocx) on a UserForm.  The object is
> not recognized on a Vista machine, and nothing similar can be replaced. Even
> though I can see the msdxm.ocx file in the actual directory, this option is
> not available under References.  What are my options to get this to run on
> multiple machines?  Can I get the msdxm.ocx version to show up on the
> Reference Library with Vista?  I can see the commands on the Object Browser
> on the Vista machine, I just don't know how to insert a "Media Player"
> instead of a "Windows Media Player".  Putting the "Media Player" on a
> worksheet works on the XP machine until the file is closed.  Upon opening, it
> crashes Excel and won't run again.
>
> Private Sub TryIt()
>     'Runs msdxm.ocx ActiveX object on UserForm1.  It actually seems to work.
>     Dim MediaFileName As String
>     MediaFileName = Range("B2")
>
>     Application.EnableEvents = True
>
>     Load UserForm1
>     UserForm1.MediaPlayer1.AutoStart = False
>     UserForm1.MediaPlayer1.Filename = MediaFileName
>     UserForm1.MediaPlayer1.ShowTracker = True
>     UserForm1.MediaPlayer1.ShowStatusBar = True
>     UserForm1.MediaPlayer1.SelectionStart = Range("B3")
>     UserForm1.MediaPlayer1.SelectionEnd = Range("B4")
>     UserForm1.MediaPlayer1.Play
>     UserForm1.Show
>     Unload UserForm1
> End Sub
>
> Using the ActiveX object which references wmp.dll on a UserForm works on
> both the XP and Vista machine.  I can set the starting point, but have no
> clue how to stop it at the desired point.  Is there a way to monitor the
> current location of the media playing and stop it?  Is there some tricky way
> the set SelectionEnd with this object?  I am guessing that I will need to
> have my own controls to get this to behave.
>
> Sub TryIt()
>     'Runs wmp.dll ActiveX object on UserForm1.  The start sort of works, but
> no end.
>     Dim MyStart As Long
>     Dim MyEnd As Long
>     Dim MyStringStart As String
>     Dim MyFile As String
>
>     MyFile = Range("B2")
>     MyStart = Range("B3")
>     MyEnd = Range("B4")
>
>     Application.EnableEvents = True
>     Load UserForm1
>     UserForm1.Caption = "Time 1 - Time 2"
>     UserForm1.WindowsMediaPlayer1.settings.autoStart = False
>
>     UserForm1.WindowsMediaPlayer1.URL = MyFile
>     UserForm1.WindowsMediaPlayer1.Controls.currentPosition = MyStart        
>     UserForm1.WindowsMediaPlayer1.Controls.Play
>     UserForm1.Show
>     Unload UserForm1
> End Sub
>
> I am open to other options.  Any help is more than appreciated.  Thanks
> Zipcurs

Take a look at this thread - Harmeet Singh posted VBA-MP3-Player.xls
which runs windows media player from within Excel. Unfortunately he
has not yet provided the password to the underlying code.
From: ZipCurs on
Hello Joel,

Thanks for the suggestion. I have been trying to use the Object Browser,
but I am not quite clear what it means. My current interpretation is ... if
you can figure out how to get to it, these object and commands are currently
available to you.

Having said that, I have no idea how to make use of msdxmlc.dll. As far as
I can tell this object is not available to me. Any help you can provide
would be appreciated.

"joel" wrote:

>
> Have you tried the DLL msdxmlc.dll?
>
>
> I see you are using the objectborowser like I suggested.
>
>
> --
> joel
> ------------------------------------------------------------------------
> joel's Profile: 229
> View this thread: http://www.thecodecage.com/forumz/showthread.php?t=178891
>
> [url="http://www.thecodecage.com"]Microsoft Office Help[/url]
>
> .
>
From: joel on

Look under tools - Reference alphabetically for "NOT PUBLIC" there is
something interesting you will see. don't know hwat it means.

If you knew the function call to the routiunes in the DLL you can use a
LIB statement to access the functions. I haven't searched the web for
this DLL but it may provide some answers.


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/showthread.php?t=178891

[url=&quot;http://www.thecodecage.com&quot;]Microsoft Office Help[/url]