On a slide of a powerpoint presentation, I added an action button (checkbox) that is clickable when I make a presentation. So I have the possibility to write a function that is as follows:
Private Sub case_choix1_Click()
Dim OSh As Shape
For Each OShp In Shapes
If OShp.Name = "answer_mask" Then
If (case_choix1.Value) Then
OShp.Visible = False
OShp.Flip msoFlipHorizontal
OShp.Flip msoFlipHorizontal
Else
OShp.Visible = True
OShp.Flip msoFlipHorizontal
OShp.Flip msoFlipHorizontal
End If
End If
Next OShp
End Sub
This function allows me to hide or see shapes that I call "answer_mask" depending on the state of my button. This function works very well with powerpoint 2010 that I used before and the execution was quick enough for me.
I now use powerpoint 2016, and this function easily takes 6-7 seconds to execute !! Even if I have less than 10 shapes and texts in total in my slide, I have this problem both when I create a new slide show or when I use my old presentations executed with powerpoint 2016.
In parallel to that, I have a more general macro that allows me to put the state of my button in a desired state. The algorithm is very similar. I'm just browsing through all my slides, find checkbox button, change de state and put "answer_mask" shapes to its default state. The time to do that is very fast.
I tried to remove all visible actions, and form manipulations. The algorithm is very fast. As soon as I add just the visible shape modification, it becomes very slow and the same for the Flip
I wonder why this part of the program takes a long time on this version of powerpoint and if you see things that need to be changed to improve its execution.
Thanks for your suggestions.