Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to play video file from Excel worksheet?

Have you ever tried to play a video file from a worksheet? In this article, I will talk about some interesting tricks for you to play a video file which is stored in your computer from an Excel workbook.

Play a video file from worksheet by setting the properties of Windows Media Player

Play a video file from worksheet by clicking a Command Button


arrow blue right bubble Play a video file from worksheet by setting the properties of Windows Media Player


In Excel, there is a useful control - Windows Media Play can help you to play a video file, please do as follows:

1. Click Developer > Insert > More Controls, see screenshot:

doc play video 1

2. In the More Controls dialog box, scroll and select Windows Media Player option, then click OK button to close the dialog, and then drag the mouse to draw a Windows Media Play object, see screenshot:

doc play video 2

3. Then go to the Properties dialog by clicking Developer > Properties, in the Properties dialog, please do the following operations:

(1.) In the Alphabetic tab, please select True option from the fullScreen field;

(2.) Copy and paste your video file path which should include the file extension into the URL field.

doc play video 3

4. After finishing the above settings, please exit Design mode, and, your specified video is playing now.


arrow blue right bubble Play a video file from worksheet by clicking a Command Button

If you want to play a video file with a command button, when you click the command button, a browse window will pop out to let you choose the video file to play. The following steps may help you:

1. According to the step 1-2 in method 1 to insert the Windows Media Player control, and then go on clicking the Developer > Insert > Command Button to insert a Command Button, see screenshot:

doc play video 4

2. Then right click the Command Button, and choose Properties from the context menu, in the popped out Properties dialog box, type the text Play Video beside the Caption field under Alphabetic tab, see screenshot:

doc play video 5

3. And then close the Properties dialog, then double click the Command Button, and then copy and paste the following VBA code to replace the original code into the Microsoft Visual Basic for Applications window.

VBA code: Play a video file from worksheet:

Private Sub CommandButton1_Click()
    Dim FName As Variant
    FName = Application.GetOpenFilename(FileFilter:="Video Files, *.mp4; *.avi; *.mpeg; *.mts", Title:="Please select a Video File", MultiSelect:=False)
    If FName <> False Then
        WindowsMediaPlayer1.Url = FName
    End If
End Sub

doc play video 6

Note: In the above code, CommandButton1 is the command button name you inserted, and the WindowsMediaPlayer1 is the Windows Media Player name you have inserted. And you can add other video file extensions as you need into the *.mp4; *.avi; *.mpeg; *.mts script.

4. Then save and close the code window, and exit the Design mode, now, when you click the Command Button, a browse window will appear to remind you select the video file you want to play, then click Open button, the specific video file will be played at once. See screenshot:

doc play video 7


Related article:

How to insert or embed youtobe video in Excel worksheet?


Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial.
kte tab 201905

Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
officetab bottom
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Simon Décary · 18 days ago
    Merci pour les explications.

    J'aime bien l'idée de lancer une vidéo en utilisant un bouton dans Excel. Est-ce qu'il est possible, avec un seul bouton, de lancer deux vidéos différentes dépendamment d'une règle de si. Exemple: Il y a une case dans Excel où on doit écrire un mot donné. Lorsqu'on clic sur le bouton, si le mot est exacte, Vidéo1 se lance. Si le mot est inexacte, vidéo 2 se lance?
  • To post as a guest, your comment is unpublished.
    Hannah B. Calbat · 9 months ago
    Where do we search???
    • To post as a guest, your comment is unpublished.
      skyyang · 9 months ago
      Hi, Calbat,
      Could you explain your problem more detailed?
      Thank you!