PowerPoint Screen Updating Nonsense

Sal Paradise

Well-known Member
Joined
Oct 23, 2006
Messages
2,457
I have created an add-in that will add disclaimers to all powerpoint presentations in a folder for a specific customer. All was working well until I decided to try to animate it. Before it would run in about 2-3 seconds per presentation, but as soon as the commented lines below are uncommented, the screen keeps refreshing 4 times per slide showing the slide animation preview (taking many more seconds).

I've tried this site's code to see if I could cut out screen updating, but that was a giant failure. I also tried to Open with "WithWindow:=False" but I can't seem to use that while having all the with statements work. I suppose if I could get that to work, it may solve my problems, but regardless I would love it if someone had some way of fixing it.

I am running Office 2000 on XP if it matters.

Here is the code:
Code:
Sub ChangeDisclaimer(strMyFile As String, CustName As String)
        
    Dim oPresentation As Presentation
    Set oPresentation = Presentations.Open(strMyFile)

    With oPresentation

        Dim oSl As Slide
       
        For Each oSl In ActivePresentation.Slides
            On Error Resume Next
            oSl.Shapes("Disclaimer").Delete
            On Error GoTo 0
            oSl.Shapes.AddTextbox(msoTextOrientationHorizontal, 108#, 515#, 504#, 24#).Name = "Disclaimer"
            
            With oSl.Shapes.Range("Disclaimer")
                .Align msoAlignBottoms, True
                .Align msoAlignCenters, True
                .TextFrame.WordWrap = msoTrue
                .Fill.Visible = msoTrue
                .Fill.Solid
                .Fill.ForeColor.RGB = RGB(255, 255, 255)
                .Line.Visible = msoTrue
                .Line.ForeColor.RGB = RGB(0, 0, 0)
                .Line.BackColor.RGB = RGB(0, 0, 0)
            End With
            
            With oSl.Shapes("Disclaimer").TextFrame.TextRange
                .Paragraphs(Start:=1, Length:=1).ParagraphFormat.Alignment = ppAlignCenter
                .Text = "Don't do bad stuff "&CustName
                With .Font
                    .NameAscii = "Arial"
                    .Size = 7
                    .BaselineOffset = 0
                    .Shadow = msoFalse
                    .Bold = msoTrue
                    .Color.RGB = RGB(0, 0, 0)
                End With
            End With

'            With oSl.Shapes("Disclaimer").AnimationSettings
'                .EntryEffect = ppEffectAppear
'                .AnimateBackground = msoTrue
'                .AnimationOrder = 1
'                .AdvanceMode = ppAdvanceOnTime
'            End With
            
        Next oSl
        
    End With
    
    oPresentation.Save
    oPresentation.Close
    
End Sub
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

Forum statistics

Threads
1,213,494
Messages
6,113,974
Members
448,537
Latest member
Et_Cetera

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top