Need VBA solution for getting Excel to load videos files onto PowerPoint slides

bc4240

Board Regular
Joined
Aug 4, 2009
Messages
134
Office Version
  1. 365
Platform
  1. Windows
I have a repeating task each week which requires me to load videos onto PowerPoint slides. I "Insert" them, choose "Hide When Not Playing", "Play Full Screen, and then choose the "Play" Animation Control for each video inserted.

Each week the videos have a standard label format like "team1stop1.mp4","team2stop2.mp4","team6stop6.mp4" etc.

I have created check boxes by every row on my excel sheet where a performance time has been recored and a video has been taken of the team performing the task.

Picture1.png

I can check the boxes of the team videos I would like to show. Then using FILTER and CONCATENATE functions I have been able to create a table that provides a list of the paths back to those vids. And the PowerPoint silde I would like the video place on. I have made additional columns for other identifiers but I'm not sure they are needed.

Picture2.png


I saw a video where shapes were being added to PowerPoint slides using a similar form like above. But video is what I need......I know there is probably a way to do this simply with VBA, but I am not a VBAer, just a copy and paster of the code. Could someone lend a hand? Thanks in Advance!
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Well it seems as if I come here with high expectations. But over the last few years I have had to answer my own questions. And this time is no exception. Maybe its a testamony of the more influential of Excel and VBA folks "Booming" off the scene and there no one here to replace the drain. Anyway enough of that. Here's what you didn't know you were waiting for :)

Video Loaded to Powerpoint using Excel and Powerpoint VBA Codeing


Easier to show it to you rather than trying to type it all out here.

Good Luck!!
 
Upvote 0
Solution
Now that you have seen the video maybe someone can explain.....high expectations......as to why this portion of the Excel VBA code is a problem:

See full code by going to the Youtube video posted above, and in the description, choose Excel VBA code link
VBA Code:
                 Set oeff1 = PPTSld.TimeLine.MainSequence.AddEffect(Shape:=PPTShp, EffectId:=msoAnimEffectFade, Trigger:=msoAnimTriggerOnClick)
                 
                 'second exit animation is not being set at all
                 Set oeff2 = PPTSld.TimeLine.MainSequence.AddEffect(Shape:=PPTShp, EffectId:=msoAnimEffectFade, Trigger:=msoAnimTriggerOnClick)
                
                        oeff2.Exit = msoTrue

            
            'Insert the Video into Appropriate Slide - The File name below needs to originate from the excel worksheet instead of hard coded.
            Set PPTShp2 = PPTSld.Shapes.AddMediaObject2(Filename:=GetVURL, _
                                             LinkToFile:=True, _
                                             SaveWithDocument:=False, _
                                                Left:=GetVLeft, _
                                                Top:=GetVTop, _
                                                Width:=GetVWidth, _
                                                Height:=GetVHeight)
                                
                                With PPTShp2.AnimationSettings.PlaySettings
                                            .PlayOnEntry = True
                                            .HideWhileNotPlaying = True
                                End With

The "Set oeff1" and "Set oeff2" portion of the code above do work together by setting both an Entry (green) and an Exit (red) Fade effect in the Animation pane in Powerpoint. However when the "Set PPTShp2" portion of the code is added to animate the video to Play, the Exit Fade effect is replaced by the Play Media animation in the Animation pane. It seems as if one of three things is happening 1) Excel thinks the Text Box and the Inserted Video are the same Shape and replaces the last animation (Exit) for the text box with a the Play animation for the video?? 2) MainSequence applies to the textbox animations, but the inserted Video cannot be assigned to the MainSequence of animation in the pane and therefore breaks the Animation Pane Sequence? 3) Older VBA code formats and newer code formats don't pair well and its a flaw in the code??

We tried everything we could, but maybe we just didn't know what the flip we were doing ......do you?
 
Upvote 0

Forum statistics

Threads
1,224,745
Messages
6,180,700
Members
452,994
Latest member
Janick

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