>Hello,
>
[quoted text clipped - 7 lines]
>text box it does not run and all I can see is that I get an entry in
>the Project Explorer
A little daylight was brought about by a comment seen in another
context - the macro security settings of PowerPoint apply to the
computer not to a particular presentation.
So, when I open PPT and change the security setting to the low state -
then the vba code works!
However, I would like to know why the following does not work when the
PPT setting is medium - any ideas?
Geoff
Sub check_number_of_slides(strMyFile As String)
Dim secAutomation As MsoAutomationSecurity
Dim oPPT As Presentation
Dim CountSlides As Integer
secAutomation = Application.AutomationSecurity
Application.AutomationSecurity = msoAutomationSecurityLow
Application.AutomationSecurity
Set oPPT = Presentations.Open(FileName:=strMyFile, WithWindow:=False)
CountSlides = oPPT.Slides.Count
oPPT.Close 'Close w/o saving.
Set oPPT = Nothing
End Sub
>VBA Project(test.ppt)
>Microsoft PowerPoint Object
[quoted text clipped - 50 lines]
>
>End Sub