Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在PowerPoint VBA gies成员中找不到特殊粘贴错误_Vba_Powerpoint_Paste - Fatal编程技术网

在PowerPoint VBA gies成员中找不到特殊粘贴错误

在PowerPoint VBA gies成员中找不到特殊粘贴错误,vba,powerpoint,paste,Vba,Powerpoint,Paste,我正在研究在Powerpoint上复制某些对象(形状、图形),然后将它们粘贴回图像 我可以很好地选择和粘贴对象,但当我为PasteSpecial编写相同的语法时,Powerpoint会抛出错误: 编译错误:找不到成员或数据成员 Sub AddPic() Dim sld As Slide Dim shp As Shape Set sld = Application.ActiveWindow.View.Slide Set shp = sld.Shapes.AddShape(Type:=msoShap

我正在研究在Powerpoint上复制某些对象(形状、图形),然后将它们粘贴回图像

我可以很好地选择和粘贴对象,但当我为PasteSpecial编写相同的语法时,Powerpoint会抛出错误: 编译错误:找不到成员或数据成员

Sub AddPic()
Dim sld As Slide
Dim shp As Shape
Set sld = Application.ActiveWindow.View.Slide
Set shp = sld.Shapes.AddShape(Type:=msoShapeRectangle, _
    Left:=50, Top:=50, Width:=100, Height:=200)

shp.Copy

shp.Fill.ForeColor.RGB = vbBlue
sld.Shapes.Paste
End Sub
以上工作如预期

现在,如果我将sld.Shapes.Paste替换为PasteSpecial,则会出现上述错误

Sub AddPic()

Dim sld As Slide
Dim shp As Shape
Set sld = Application.ActiveWindow.View.Slide
Set shp = sld.Shapes.AddShape(Type:=msoShapeRectangle, _
    Left:=50, Top:=50, Width:=100, Height:=200)
shp.Copy  
shp.Fill.ForeColor.RGB = vbBlue

'sld.Shapes.Paste

sld.Shapes.PasteSpecial

End Sub

有没有人面临过类似的问题?提前感谢您的帮助。
我正在使用Mac的最新Powerpoint

无法复制,但我在Windows上。也许试着给它一些时间,一些
DoEvents
?第二个代码在Windows上工作正常吗?查找DoEvents-还不确定在这种情况下它将如何使用?是的,它对我有效。感谢您的回复。我看到这在我的窗口上运行良好。因此,这似乎是Mac特有的问题。