Excel VBA:操作 Shockwave Flash 属性
我正在开发一个小项目,在 Excel 中制作带有 YouTube 视频的“模因播放器” - 这是电子表格的屏幕截图
我尝试的代码使用是 。
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
如果您能告诉我如何让脚本与我在 Excel 界面中命名为“Memeplayer”的嵌入式 Shockwave Flash 完美配合,我将不胜感激 我用来尝试让它运行的行是:
Memeplayer.SetVariable("Movie", sLookupValue)
但它只返回一个“需要对象”错误(运行时错误 424)。我还没有太多地处理形状和物体,而且我不知道如何解决它。请帮助我!
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
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)
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我已经解决了这个问题。我只是没有正确设置对象 - 无法弄清楚它的层次结构。代码如下:
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:
VBA 有很多限制,尝试在 Excel 中执行类似操作可能不是最好的方法。不过,这里有 2 个网站可能可以帮助您解决问题:
希望这会有所帮助。
VBA has many limitations and trying to do something like this in Excel is probably not the best way to go about it. However, here are 2 websites that might shed some light on your problem:
Hope this helps.