VBA: Set Shockwave Flash Property as Variable using VLookup

OneCurtis

New Member
Joined
May 20, 2011
Messages
13
Hi, I'm creating a youtube video player with an embedded Shockwave Flash player, dropdown list and a range of video names and urls. However, I can't seem to Set the Shockwave Flash, having tried a number of methods.

Here's a picture of the sheet to help those with a visual preference - http://i.imgur.com/wLXah.png. The Vlookup range is hidden in two columns to the left.

I know I've probably made a small oversight (I don't have any experience manipulating these kind of objects) but here's the code I've got so far:

Code:
Sub PlaySamsMemes()

Dim sChosenTitle As String
Dim rngVideoData As Range
Dim MemePlayer As ShockwaveFlash
Dim lFinalRow As Long
Dim sLookupValue As String

lFinalRow = Cells(Rows.Count, 3).End(xlUp).Row
sChosenTitle = Range("F4").Value
Set rngVideoData = Range("B2:C62" & lFinalRow)
sLookupValue = Application.VLookup(sChosenTitle, rngVideoData, 2, False)

MemePlayer.SetVariable "Movie", sLookupValue

End Sub
It's returning Error 91 in Ex2010 and 424 in Ex2007 - Object variable or With block not set.

I've obviously tried the traditional 'Set' (obviously having modified the code from it's present state) to no avail and the macro recorder doesn't display anything when you change an Objects properties in the Ex interface, so I'm not sure what to do. Any help will be greatly appreciated. Thanks.
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Fixed it myself yesterday. Pretty simple really.

Code:
Set MemePlayer = Sheets(1).MemePlayer
MemePlayer.Movie = sLookupValue
 
Upvote 0

Forum statistics

Threads
1,215,262
Messages
6,123,952
Members
449,135
Latest member
jcschafer209

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
Back
Top