Mp3 input

Wil Moosa

Well-known Member
Joined
Aug 11, 2002
Messages
882
I’m desperately, desperately seeking for an answer on this one.

I have a userform with a X-control media player. I know that I can use the properties to define the mp3 input. I need to know if it is possible to define the input differently. I like to refer to the active cell (where the full path can be found).

Ivan came up with the following but that does not work.

Sub PlayPlayer1()
MediaPlayer1.Open "D:\Audio\MP3_Pop\Al Stewart - On the border.mp3"
End sub

I scavenged the web for information on this a few nights but correct me if I'm wrong but I find the userform info on the media player very poorly documented.
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,958
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Are you using the Windows Media Player Control?
 

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,958
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Give something like this a try:

Private Sub UserForm_Activate()
WindowsMediaPlayer1.URL = "file://" & ActiveCell.Text
End Sub
 

Wil Moosa

Well-known Member
Joined
Aug 11, 2002
Messages
882

ADVERTISEMENT

(translated) Error message is: "Windows Media Player can not play the file as the given protocol is not supported. Try to open the file in the dialog window "open URL" with another transport protocol (e.g. http, rts") ".
 

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,958
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
What version of Windows Media Player are you running?

I tested my code with Windows Media Player 9, XL2002 running on Windows 2000 Pro.
 

Wil Moosa

Well-known Member
Joined
Aug 11, 2002
Messages
882
Hotpepper, I fiddled a bit with your code and suddenly realised that your composition of the path was didfferent from mine. The code that worked fine finally was WindowsMediaPlayer1.URL = ActiveCell.Value

When using WindowsMediaPlayer1.URL for searching the web... plenty of additional information turned up. I learned there that the coding for the several versions of the player is different (after version 9?).

Thanks for the help with this one.
 

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,958
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
I don't know if this will help, but it didn't seem to care if it had the file:// part or not:

Code:
Private Sub UserForm_Activate()
WindowsMediaPlayer1.URL = ActiveCell.Text
End Sub
 

Forum statistics

Threads
1,147,845
Messages
5,743,513
Members
423,801
Latest member
paulj4177

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top