i'm trying to figure out a way to embed a video into a user form in Excel VBA, but the issue that im facing is that, according to some sites, that you need to add the "Shockwave Flash Object" control and use it to embed the youtube video into a user form, but I can't seem to find the Shockwave Flash Object in the additional controls list. Is there some reference that I need to add? Or is there an easier way to embed a youtube video into the user form?
Well I did find that control in the list and then it works just like that:
Private Sub CommandButton1_Click()
With Me.ShockwaveFlash1
.LoadMovie 0, "http://www.youtube.com/v/jmHkMsrycBw"
End With
End Sub
But if you need an alternative, you can display an embedded object on a Webbrowser control ('Microsoft Web Browser' in the controls list).
Private Sub CommandButton2_Click()
With WebBrowser1
.Navigate2 "about:" & _
"<body style=""margin:0px;padding:0px"">" & _
"<object width=""100%"" height=""100%"" type=""application/x-shockwave-flash"" data=""http://www.youtube.com/v/jmHkMsrycBw&hl=de&fs=1&color1=0x3a3a3a&color2=0x999999&border=1"">" & _
"<param name=""movie"" value=""http://www.youtube.com/v/jmHkMsrycBw&hl=de&fs=1&color1=0x3a3a3a&color2=0x999999&border=1"" />" & _
"<param name=""allowFullScreen"" value=""true"" />" & _
"</object></body>"
End With
End Sub
More Info on embedding code:
https://developers.google.com/youtube/player_parameters
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With