【发布时间】:2015-12-22 09:00:02
【问题描述】:
我有一个宏,我在 Office 2007 中与一些 ppt 一起使用,以减小 ppt 中某些链接到 excel 文件的大小。最近我安装了 Office 2013,宏崩溃并出现以下错误:
Shape.select:无效请求。要选择一个形状,它的视图必须是活动的
代码如下:
Sub reduce()
For Each curr_slide In ActivePresentation.Slides
curr_slide.Select
For Each oSh In curr_slide.Shapes
If oSh.Type = msoLinkedOLEObject Then
Set oSh = curr_slide.Shapes(3)
With oSh
'.LinkFormat.BreakLink
.Select
.LockAspectRatio = False
.Height = 14 * 28.33
.Width = 33.5 * 28.33
.Cut
Set oSh = curr_slide.Shapes.PasteSpecial(DataType:=ppPastePNG)
.Height = 10 * 28.33
.Width = 23 * 28.33
.Left = 1.2 * 28.33
.Top = 1.85 * 28.33
.ZOrder (msoSendToBack)
End With
End If
Next oSh
Next curr_slide
End Sub
我现在相信,我必须激活每张幻灯片中的每个形状,但我不知道该怎么做。
【问题讨论】:
标签: size powerpoint shape reduce