Hello,
I'm struggling with a strange problem. I'm writing some Excel VBA to perform some analysis on a large batch of PowerPoint presentations that I'm working on. I ultimately want to generate a worksheet for each presentation with some stats on it - number of slides, number of shapes on each slide etc.
The issue I'm having, however, is much more fundamental - it keeps crashing for some reason, and it's always when I'm making use of slide objects. For example:
Option Explicit
Sub Analysis()
Dim ppApp As PowerPoint.Application
Dim ppPres As PowerPoint.Presentation
Dim ppSlide As PowerPoint.Slide
Dim ppShape As PowerPoint.Shape
Dim FileName As String
FileName = Application.GetOpenFilename
Set ppApp = New PowerPoint.Application
ppApp.Visible = True
Set ppPres = ppApp.Presentations.Open(FileName)
Set ppSlide = ppPres.Slides(8)
end sub
That last line will trigger a crash, every time. It doesn't matter what I actually refer to - I've just used slide 8 as an example here. Any use of ppSlide, or any attempt to refer to a specific slide in the presentation, will crash Excel.
I'm using Mac OS X High Sierra 10.13.6, and Excel 16.16.1
All help gratefully appreciated!
Bookmarks