【发布时间】:2014-12-14 02:10:29
【问题描述】:
我试图从给定位置打开一个 ppt,并试图破坏 ppt 中的所有链接。打开 ppt 后,我无法从那里从 excel 调用 ppt,因此代码出错。给我错误的行如下 - “对于 ActiveWindow.Slides 中的每个 Sld” - 对象不支持此属性或方法。任何帮助将不胜感激。
Sub Breaklinks()
Dim file As String
Dim PPT As Object
Dim Sld As Slide
Dim Sh As Shape
file = Cells(4, 2).Value & "\" & Cells(4, 3).Value
Set PPT = CreateObject("PowerPoint.Application")
PPT.Visible = True
PPT.Presentations.Open file
For Each Sld In ActiveWindow.Slides
For Each Sh In Sld.Shapes
If Sh.Type = msoLinkedOLEObject Then
Sh.LinkFormat.BreakLink
End If
Next
Next
End Sub
【问题讨论】:
标签: excel powerpoint vba