PowerPoint animation simultaneous to macro engagement

%3CLINGO-SUB%20id%3D%22lingo-sub-1982294%22%20slang%3D%22en-US%22%3EPowerPoint%20animation%20simultaneous%20to%20macro%20engagemant%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1982294%22%20slang%3D%22en-US%22%3E%3CP%3EAt%20the%20beginning%20I%20thought%20I%20was%20doing%20something%20wrong%2C%20however%20several%20hours%20of%20testing%20yield%20to%20the%20conclusion%20that%20cannot%20coexist%20on%20the%20same%20slide%20both%20shapes'%20animation%26nbsp%3B%20and%20macro%20engagement%20on%20click%20on%20a%20shape.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAs%20long%20as%20the%20click%20on%20the%20shape%2C%20instead%20of%20engaging%20the%20macro%2C%20the%20slide%20restarts%20the%20animation%20from%20the%20beginning.%3C%2FP%3E%3CP%3ENo%20mater%20how%20many%20efforts%20I%20have%20made%20under%20all%20possible%20conditions%20of%20engaging%20animation.%3C%2FP%3E%3CP%3EI%20dramatically%20failed%20to%20coexist%20animation%20and%20macro%20engagement!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EObviously%2C%20PowerPoint%20mouse%20clicks%20handler%2C%20gives%20priority%20to%20animation.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20my%20conclusion%20correct%20or%20am%20I%20doing%20something%20wrong%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFinally%2C%20can%20I%20have%20animation%20and%20macro%20engagement%20on%20the%20same%20slide%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1982945%22%20slang%3D%22en-US%22%3ERe%3A%20PowerPoint%20animation%20simultaneous%20to%20macro%20engagement%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1982945%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F899744%22%20target%3D%22_blank%22%3E%40IoannisKar%3C%2FA%3E%26nbsp%3BFinally%2C%20I%20pinpointed%20an%20origin%20of%20the%20problem.%3C%2FP%3E%3CP%3EI%20proved%20that%20the%20incompatibility%20exists%20upon%20insertion%20of%20certain%20VBA%20code%20in%20the%20biased%20to%20the%20shape%20macro.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20written%20a%20small%20piece%20of%20code%3C%2FP%3E%3CP%3EOption%20Explicit%3C%2FP%3E%3CP%3EPublic%20Const%20Black_00%20As%20Long%20%3D%200%3CBR%20%2F%3EPublic%20Const%20White_00%20As%20Long%20%3D%2016777215%3CBR%20%2F%3EPublic%20Const%20Normal_01%20As%20Long%20%3D%2016317177%3CBR%20%2F%3EPublic%20Const%20Green_01%20As%20Long%20%3D%205287936%3CBR%20%2F%3EPublic%20Const%20Red_00%20As%20Long%20%3D%20255%3CBR%20%2F%3EPublic%20Const%20Orange_01%20As%20Long%20%3D%201942262%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPublic%20Sub%20flipFlopColor(oShp%20As%20Shape)%3CBR%20%2F%3EDim%20fillColor%20As%20Long%3CBR%20%2F%3EDim%20fontColor%20As%20Long%3CBR%20%2F%3EDim%20lCol%20As%20Long%3CBR%20%2F%3EDim%20yesShp%20As%20Shape%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EoShp.ZOrder%20msoBringToFront%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E'%20fontColor%20%3D%20oShp.TextFrame.TextRange.Font.Color.RGB%3CBR%20%2F%3E'%20fillColor%20%3D%20oShp.Fill.ForeColor.RGB%3CBR%20%2F%3E'%20Debug.Print%20%22shp%3A%20%22%20%26amp%3B%20oShp.Name%20%26amp%3B%20%22%20font%3A%20%22%20%26amp%3B%20fontColor%20%26amp%3B%20%22%20--%26gt%3Bfill%3A%20%22%20%26amp%3B%20fillColor%3CBR%20%2F%3E%3CBR%20%2F%3EIf%20fillColor%20%3D%20Green_01%20Then%3CBR%20%2F%3EoShp.Fill.ForeColor.RGB%20%3D%20Red_00%3CBR%20%2F%3EoShp.TextFrame.TextRange.Font.Color.RGB%20%3D%20White_00%3CBR%20%2F%3EElse%3CBR%20%2F%3EoShp.Fill.ForeColor.RGB%20%3D%20Green_01%3CBR%20%2F%3E'%20oShp.TextFrame.TextRange.Font.Color.RGB%20%3D%20Black_00%3CBR%20%2F%3EEnd%20If%3CBR%20%2F%3EEnd%20Sub%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20animation%20was%20working%20with%20the%20macro%20on%20the%20same%20slide%20without%20any%20problem.%3C%2FP%3E%3CP%3EThen%20I%20inserted%20in%20the%20macro%20the%20following%20VBA%20line%20of%20code%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EoShp.ZOrder%20msoBringToFront%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EImmediately%20after%20that%2C%20upon%20clicking%20on%20the%20shape%20biased%20to%20the%20macro%20the%20animation%20restarts.%3C%2FP%3E%3CP%3EI%20tested%20with%20more%20pieces%20of%20code%20and%20the%20result%20is%20the%20same.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGiven%20that%2C%20theoretically%2C%20one%20can%20include%20any%20piece%20of%20valid%20VBA%20code%20into%20the%20MACRO%2C%20and%20given%20that%20only%20exceptionally%20compatibility%20does%20exist%2C%20we%20can%20safely%20conclude%20that%20animation%20and%20macro%20execution%20are%20not%20compatible%20on%20the%20same%20slide.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20afraid%20that%20MSO%20PowerPointProgrammers%20should%20take%20care%20of%20this%20issue.%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

At the beginning I thought I was doing something wrong, however several hours of testing yield to the conclusion that cannot coexist on the same slide both shapes' animation  and macro engagement on click on a shape.

 

As long as the click on the shape, instead of engaging the macro, the slide restarts the animation from the beginning.

No mater how many efforts I have made under all possible conditions of engaging animation.

I dramatically failed to coexist animation and macro engagement!

 

Obviously, PowerPoint mouse clicks handler, gives priority to animation.

 

Is my conclusion correct or am I doing something wrong?

 

Finally, can I have animation and macro engagement on the same slide?

1 Reply

@IoannisKar Finally, I pinpointed an origin of the problem.

I proved that the incompatibility exists upon insertion of certain VBA code in the biased to the shape macro.

 

I have written a small piece of code

Option Explicit

Public Const Black_00 As Long = 0
Public Const White_00 As Long = 16777215
Public Const Normal_01 As Long = 16317177
Public Const Green_01 As Long = 5287936
Public Const Red_00 As Long = 255
Public Const Orange_01 As Long = 1942262

 

Public Sub flipFlopColor(oShp As Shape)
Dim fillColor As Long
Dim fontColor As Long
Dim lCol As Long
Dim yesShp As Shape


oShp.ZOrder msoBringToFront


' fontColor = oShp.TextFrame.TextRange.Font.Color.RGB
' fillColor = oShp.Fill.ForeColor.RGB
' Debug.Print "shp: " & oShp.Name & " font: " & fontColor & " -->fill: " & fillColor

If fillColor = Green_01 Then
oShp.Fill.ForeColor.RGB = Red_00
oShp.TextFrame.TextRange.Font.Color.RGB = White_00
Else
oShp.Fill.ForeColor.RGB = Green_01
' oShp.TextFrame.TextRange.Font.Color.RGB = Black_00
End If
End Sub

 

The animation was working with the macro on the same slide without any problem.

Then I inserted in the macro the following VBA line of code

 

oShp.ZOrder msoBringToFront

 

Immediately after that, upon clicking on the shape biased to the macro the animation restarts.

I tested with more pieces of code and the result is the same.

 

Given that, theoretically, one can include any piece of valid VBA code into the MACRO, and given that only exceptionally compatibility does exist, we can safely conclude that animation and macro execution are not compatible on the same slide.

 

I am afraid that MSO PowerPointProgrammers should take care of this issue.