|
4#
楼主 |
发表于 2008-11-8 18:35:06
|
只看该作者
附, 插入SWF文件到EXCEL SHEET的代码,插入完成后,需要根据SWIFF生成的SWF文件大小再调整一下尺寸.
Sub InsertSWF()
Dim Fp
Dim Swf As String
Fp = Application.GetOpenFilename("Flash文件,*.swf", , "选择FLASH文件", , False)
If Fp = False Then Exit Sub
ActiveSheet.OLEObjects.Add(ClassType:="ShockwaveFlash.ShockwaveFlash.9", _
Link:=False, DisplayAsIcon:=False, Left:=20, Top:=20, Width:= _
450, Height:=300).Select
Swf = Selection.Name
ActiveSheet.OLEObjects(Swf).Object.EmbedMovie = True
ActiveSheet.OLEObjects(Swf).Object.Menu = False
ActiveSheet.OLEObjects(Swf).Object.Movie = Fp
Range("D8").Select
Application.CommandBars("Exit Design Mode").Visible = True
Application.CommandBars("Exit Design Mode").Controls(1).Execute
End Sub |
|