Play Videos in Excel with VBA
Post date: Nov 29, 2013 8:52:53 PM
Why Read This?
Add videos to Excel without warning messages like this one.
The "Normal" Way Causes Warnings:
We can add Windows Media Player to Excel like this:
Click Excel's Developer tab
Click Insert option in Controls grouping
Click More Controls icon in the bottom right of the Forms Control Toolbox dialog
Scroll to the bottom of More Controls dialog and select Windows Media Player.
Click and drag the size of the Windows Media Player
Set Properties
And in all likelihood, add VBA code to show/hide the player and load videos
But it makes our Excel workbooks unnecessarily larger and when our workbook opens we get somewhat alarming warnings.
This Way is Better
With very little VBA code, we can play a video from Excel. No references required.
Dim WMP as Object
Set WMP = CreateObject("new:{6BF52A52-394A-11d3-B153-00C04F79FAA6}")
Wmp.OpenPlayer "C:\Users\Public\Videos\Sample Videos\Wildlife.wmv"
This method:
Keeps our workbooks smaller
Runs Windows Media Player outside of Excel
Avoids the nasty warning
Why Add Video to Excel?
Add video help to your applications
Create playlists in Excel and have Excel show them through Windows Media Player