How to Play Videos in Excel with VBA | Instructions for Inserting Videos into Excel

preview_player
Показать описание
In this video, we’ll be showing you how to play video in Excel.

Excel offers a feature to play a local video on your computer using Windows Media Player. If you want to include a video with your spreadsheet on your computer, this video will show you how to do it! Let’s play a video in this spreadsheet.

1. Click File - Options - Customize Ribbon, and check the Developer box on the right.
2. Go to the Developer tab at the top and click Insert - Command Button.
3. Click Properties at the top and change the Caption. There are also color options here if you want to change those too.
4. Double-click the button to open the VBA window. This is where we tell the button what we want it to do, which is open a video on our computer.
5. Type this text down from the screen or copy and paste it:
Dim WMP As Object
Set WMP = CreateObject("new:{6BF52A52-394A-11d3-B153-00C04F79FAA6}")
WMP.OpenPlayer "Replace with your video URL"
6. Replace the text here with your video URL. To get your video URL, open the File Explorer and navigate to your video’s location.
7. Click the top address bar to get the URL.
8. This is just the address to the folder, we need to add the file name with a backslash, the name of the file, and the extension, which is .mp4 in this case.
9. Select the entire address and Copy it.
10. Go back to Excel and paste it in between the double quotes.
11. Exit the VBA window.
12. Un-toggle Design Mode at the top, and click the button to test if the video plays.

We now can play a video whenever we want simply by clicking a button. Make sure the VBA code is typed in correctly and the URL with the file name and extension is correct too!

❓💬 What other tricks in Excel would you like to learn? Let us know in the comments below.

#HowTech #Excel
--------------------------------------------------------------------------------------------------------------
Рекомендации по теме
Комментарии
Автор

can you make it go full screen in the macro?

MrWaterhousemark
Автор

Thanks for sharing that, I'm sure that it would come in handy for a presentation.

josephcosgroveFfl
Автор

How can we do the same with Films&TV player?

djalmasilva
Автор

on sharepoint, is it possible to do this with the video file stored in onedrive?

icarus
Автор

how to play more video on one userform with more command button which every command button is 1 video

sikkin
Автор

great vid, but if I want to play a youtbue video, what now?? thanks

缺口