Excel.Shape shape = ((Excel.Worksheet)(tapp.ActiveSheet)).Shapes.AddOLEObject("ShockwaveFlash.ShockwaveFlash.16", null
, true, false, null, null, null, x, y, 75, 75);
(Boolean)shape.OLEFormat.Object.GetType().InvokeMember("EmbedMovie", BindingFlags.GetProperty, null, shape.OLEFormat.Object, new object[] { });
老是抛出异常" 未知名称。 (异常来自 HRESULT:0x80020006 (DISP_E_UNKNOWNNAME))"
但是
Type type = Type.GetTypeFromProgID("ShockwaveFlash.ShockwaveFlash.16");
object obj = Activator.CreateInstance(type, false);
Boolean b = (Boolean)obj.GetType().InvokeMember("EmbedMovie", BindingFlags.GetProperty, null, obj, new object[] { });
可以正常执行,这是为什么,shape.OLEFormat.Object为啥不能被得到属性?