Excel VBA:操纵Shockwave Flash属性 [英] Excel VBA: Manipulate Shockwave Flash Property
问题描述
我正在开展一个小项目,通过YouTube视频在Excel中创建一个memeplayer - 以下是电子表格的屏幕截图。
I'm working on a little project to make a 'memeplayer' in Excel with YouTube videos - here's a screenshot of the spreadsheet
我试图使用的代码如下:
The code I'm attempting to use is below:
Option Explicit
Sub PlaySamsMemes()
Dim sChosenTitle As String
Dim rngVideoData As Range
Dim lFinalRow As Long
Dim sLookupValue As String
lFinalRow = Range("C65536").End(xlUp).Row
sChosenTitle = Range("F4").Value
Set rngVideoData = Range("B2:C" & lFinalRow)
sLookupValue = Application.VLookup(sChosenTitle, rngVideoData, 2, False)
Memeplayer.SetVariable("Movie", sLookupValue)
End Sub
如果您能告诉我如何让脚本玩得很好,我将非常感激嵌入Shockwave Flash我在Excel界面中命名了Memeplayer。我正在尝试使用它的行是:
I'd be really grateful if you could tell me how to get the script to play nice with the embedded Shockwave Flash that I've named 'Memeplayer' in the Excel interface. The line I'm using to try and make it run is:
Memeplayer.SetVariable(Movie,sLookupValue)
Memeplayer.SetVariable("Movie", sLookupValue)
但它只是返回一个对象必需错误(运行时错误424)。我还没有使用形状和对象,我不知道如何解决它。请帮助我!
but it just returns an 'Object required' error (Runtime Error 424). I've not worked with shapes and objects much as yet and I've no idea how to fix it. Help me please!
推荐答案
我已经解决了这个问题。我只是没有正确设置对象 - 无法弄清楚它的真相。代码如下:
I've since solved the problem. I just hadn't Set the Object correctly - couldn't figure out the heirachy for it. The code is below:
Set MemePlayer = Sheets(1).MemePlayer
MemePlayer.Movie = sLookupValue
这篇关于Excel VBA:操纵Shockwave Flash属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!