我有一个过早关闭 PowerPoint 的 PowerPoint Shape。用粘贴或保存到文件替换它可以解决问题。 我怀疑某些更改的属性(名称和 ID 除外)。 如何比较两个形状的每个属性? shape是嵌入图片,Type是#13,msoPicture
无法从原始属性中找出它是如何粘贴的(PNG、JPG 等) 尝试过非编程方法
没有解决实际问题的解决方法
特定文件崩溃 媒体导致崩溃 所有文件崩溃 MS 推荐 另一种适用于所有文件的情况 在文件中使用媒体时 PowerPoint 崩溃 - Microsoft 支持 Powerpoint 因不明原因在特定文件上崩溃 - Microsoft Community
对于 PowerPoint: • 查看提高演示文稿性能的技巧 • 更改分辨率以提高速度 • 确保未禁用硬件图形加速 • 压缩媒体文件 • 减少过渡和复杂动画的数量 • 不要使用大渐变或透明物体
防病毒和安全软件 防病毒软件和其他安全代理可能会对 Office 应用的性能产生负面影响。虽然在软件执行其预期工作时不可避免会产生一定程度的影响,但在许多情况下,使用这些产品可能会导致重大的意外性能问题,因为软件会以意想不到的方式与其他代理、Windows 和 Office 应用程序交互。虽然无法消除企业安全代理的影响,但可以通过遵循一些准则来减轻影响: • 对在您的环境中运行的安全软件和代理进行清点,并删除不再需要的任何软件和代理。 • 确保您运行的是所有必需安全软件的最新版本。 • 在没有运行安全代理的设备上运行 Office 应用程序,并使用性能测试指南在运行安全代理的设备上运行应用程序时比较性能。如果存在明显差异(超过几秒),请与您的安全软件供应商合作,确定可以配置以减轻性能影响的设置或排除项。
Option Explicit
Sub ReadPPT()
Dim WB As Workbook
Dim PP As PowerPoint.Application
Dim Pres As PowerPoint.Presentation
Dim SLD As PowerPoint.Slide
Dim SHP As PowerPoint.Shape
Dim PresPath As String
Dim r As Long
Dim sh As Long
Set WB = ThisWorkbook
With ThisWorkbook.Sheets(1)
'Let user select a ppt-file and select its path
PresPath = Application.GetOpenFilename("PowerPoint Presentations (*.pptx), *.pptx", _
, "Open Presentation", "Open", 0)
If PresPath = "" Then Exit Sub
'Create ppt-Application and show it
Set PP = CreateObject("PowerPoint.Application")
PP.Visible = True
'Open previously selected ppt-file
Set Pres = PP.Presentations.Open(PresPath)
Stop
r = 1
.Cells(0 + r, 1) = CStr(Pres.FullName)
.Cells(0 + r, 2) = CStr(Now)
r = r + 1
sh = 1
For Each SLD In Pres.Slides
r = 2
If SLD.Shapes.Count > 1 Then
For Each SHP In SLD.Shapes
'To list types
' modified https://www.rdpslides.com/pptfaq/FAQ00007_Show_me_the_-Type_of_each_object_on_a_slide.htm
Dim it As String
With SHP
''''''''''''''''''''''''
Select Case .Type
Case msoAutoShape 'Type 1
it = "an AutoShape"
Case msoCallout 'Type 2
it = "a Callout"
Case msoChart 'Type 3
it = "a Chart"
' Note that you'll never actually SEE one of these in PPT. It's an Excel-only thing.
Case msoComment 'Type 4
it = "a Comment"
Case msoFreeform 'Type 5
it = "a Freeform"
Case msoGroup 'Type 6
it = "a Group"
Case msoEmbeddedOLEObject 'Type 7
it = "an Embedded OLE Object"
Case msoFormControl 'Type 8
it = "a Form Control"
Case msoLine 'Type 9
it = "a Line"
Case msoLinkedOLEObject 'Type 10
it = "a Linked OLE Object"
With .LinkFormat
MsgBox (.SourceFullName)
End With
Case msoLinkedPicture 'Type 11
it = "a Linked Picture"
With .LinkFormat
MsgBox (.SourceFullName)
End With
Case msoOLEControlObject 'Type 12
it = "an OLE Control Object."
Case msoPicture 'Type 13
it = "a embedded picture."
Stop
Case msoPlaceholder 'Type 14
it = "a text placeholder (title or regular text--not a standard textbox) object."
Case msoTextEffect 'Type 15
it = "a WordArt (Text Effect)."
Case msoMedia 'Type 16
it = "a Media object .. sound, etc."
With .LinkFormat
MsgBox (.SourceFullName)
End With
Case msoTextBox 'Type 17
it = "a Text Box"
Case msoScriptAnchor 'Type # not checked
it = " a ScriptAnchor"
Case msoTable
it = " a Table" 'Type 19
Case msoShapeTypeMixed 'Type # not checked
it = "a Mixed object (whatever that might be)."
Case Else 'Just in case MS adds some new types
it = "a mystery!!! ?An undocumented object type?" & _
" Haven't found one of these yet"
End Select
End With
MsgBox ("I'm " & it & " Type is # " & SHP.Type)
.Cells(0 + r, 2) = CStr(SHP.Name)
.Cells(0 + r, 3) = CStr(it)
.Cells(0 + r, 4) = " Type is # " & CStr(SHP.Type)
If SHP.HasTextFrame Then
If SHP.TextFrame.HasText Then
Stop
.Cells(0 + r, 5) = CStr(SHP.Name)
.Cells(0 + r, 7) = CStr(SHP.TextFrame.TextRange.Text)
End If
End If
r = r + 1
Next SHP
sh = sh + 1
End If
Next SLD
PP.Quit
End With
End Sub