跳到主要內容

如何從Excel工作表播放視頻文件?

您是否曾經嘗試從工作表中播放視頻文件? 在本文中,我將討論一些有趣的技巧,這些技巧可用來播放視頻文件,該視頻文件是從Excel工作簿存儲在計算機中的。

通過設置Windows Media Player的屬性來播放工作表中的視頻文件

通過單擊命令按鈕從工作表中播放視頻文件


箭頭藍色右氣泡 通過設置Windows Media Player的屬性來播放工作表中的視頻文件

在Excel中,有一個有用的控件- Windows Media Play 可以幫助您播放視頻文件,請執行以下操作:

1。 點擊 開發者 > 插入 > 更多控件,請參見屏幕截圖:

doc播放影片1

2。 在 更多控件 對話框,滾動並選擇 Windows媒體播放器 選項,然後單擊 OK 按鈕關閉對話框,然後拖動鼠標繪製一個 Windows Media Play 對象,請參見屏幕截圖:

doc播放影片2

3。 然後去看看 氟化鈉性能 通過單擊對話框 開發者 > 氟化鈉性能氟化鈉性能 對話框,請執行以下操作:

(1.)在 字母順序 標籤,請從 全屏 領域;

(2.)複製並粘貼您的視頻文件路徑,該路徑應包括文件擴展名。 網址 領域。

doc播放影片3

4。 完成以上設置後,請退出 設計模式,並且您正在播放指定的視頻。


箭頭藍色右氣泡 通過單擊命令按鈕從工作表中播放視頻文件

如果要使用命令按鈕播放視頻文件,請在單擊命令按鈕時彈出瀏覽窗口,讓您選擇要播放的視頻文件。 以下步驟可以為您提供幫助:

1。 根據方法1中的步驟2-1插入 Windows媒體播放器 控件,然後繼續單擊 開發者 > 插入 > 命令按鈕 要插入命令按鈕,請參見屏幕截圖:

doc播放影片4

2。 然後右鍵單擊“命令按鈕”,然後選擇 氟化鈉性能 從上下文菜單中,彈出 氟化鈉性能 對話框中鍵入文本 播放視頻 旁邊的 標題 田野下 字母順序 標籤,請參見屏幕截圖:

doc播放影片5

3。 然後關閉 氟化鈉性能 對話框,然後雙擊命令按鈕,然後復制並粘貼以下VBA代碼以將原始代碼替換為 Microsoft Visual Basic for Applications 窗口。

VBA代碼:播放工作表中的視頻文件:

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播放影片6

備註:在上面的代碼中, 命令按鈕 1 是您插入的命令按鈕名稱, WindowsMediaPlayer1 是您插入的Windows Media Player名稱。 您還可以根據需要將其他視頻文件擴展名添加到 * .mp4; * .avi; * .mpeg; * .mts 腳本。

4。 然後保存並關閉代碼窗口,然後退出 設計模式,現在,當您單擊命令按鈕時,將出現一個瀏覽窗口,提醒您選擇要播放的視頻文件,然後單擊 已提交 按鈕,將立即播放特定的視頻文件。 看截圖:

doc播放影片7


相關文章:

如何在Excel工作表中插入或嵌入視頻?

最佳辦公生產力工具

🤖 Kutools 人工智慧助手:基於以下內容徹底改變數據分析: 智慧執行   |  生成代碼  |  建立自訂公式  |  分析數據並產生圖表  |  呼叫 Kutools 函數...
熱門特色: 尋找、突出顯示或識別重複項   |  刪除空白行   |  合併列或儲存格而不遺失數據   |   沒有公式的回合 ...
超級查詢: 多條件VLookup    多值VLookup  |   跨多個工作表的 VLookup   |   模糊查詢 ....
高級下拉列表: 快速建立下拉列表   |  依賴下拉列表   |  多選下拉列表 ....
欄目經理: 新增特定數量的列  |  移動列  |  切換隱藏列的可見性狀態  |  比較範圍和列 ...
特色功能: 網格焦點   |  設計圖   |   大方程式酒吧    工作簿和工作表管理器   |  資源庫 (自動文字)   |  日期選擇器   |  合併工作表   |  加密/解密單元格    按清單發送電子郵件   |  超級濾鏡   |   特殊過濾器 (過濾粗體/斜體/刪除線...)...
前 15 個工具集12 文本 工具 (添加文本, 刪除字符,...)   |   50+ 圖表 類型 (甘特圖,...)   |   40+ 實用 公式 (根據生日計算年齡,...)   |   19 插入 工具 (插入二維碼, 從路徑插入圖片,...)   |   12 轉化 工具 (數字到單詞, 貨幣兌換,...)   |   7 合併與拆分 工具 (高級合併行, 分裂細胞,...)   |   ... 和更多

使用 Kutools for Excel 增強您的 Excel 技能,體驗前所未有的效率。 Kutools for Excel 提供了 300 多種進階功能來提高生產力並節省時間。  點擊此處獲取您最需要的功能...

產品描述


Office選項卡為Office帶來了選項卡式界面,使您的工作更加輕鬆

  • 在Word,Excel,PowerPoint中啟用選項卡式編輯和閱讀,發布者,Access,Visio和Project。
  • 在同一窗口的新選項卡中而不是在新窗口中打開並創建多個文檔。
  • 將您的工作效率提高 50%,每天為您減少數百次鼠標點擊!
Comments (6)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
I have a file of  a number of URLs to music videos.  I'm not sure of the file extensions, because I see only the URLs.  When one video is finished, I want it to go automatically to the next music video, within the range of videos specified. I don't want to have to get up and click the next URL.  I'm not sure how the vba macro could tell the video is finished.  Is there a property that I can read with a function? A do loop should work fine for going through the list of URLs (hyperlinks), but just need to detect when a video is finished.  Can you help?
This comment was minimized by the moderator on the site
This worked for me but what I want to add is the ability to pause the player and also to have a timer event that checks to see if the player has finished so that I can then load the next track, don't really want to do this with playlists as I prefer to keep control of what is playing in my vba. Long story as to why which I can elaborate on if needed but really if you can give a hint as to how to pause and check playing status that will do,Thanks
This comment was minimized by the moderator on the site
This isn't working for me, what do I put in for WindowsMediaPlayer1?? I get that location as my error, I'm not sure what thats supposed to be. I had it have the same name as my file and it didn't bug but it also didn't play a video
This comment was minimized by the moderator on the site
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?
This comment was minimized by the moderator on the site
Where do we search???
This comment was minimized by the moderator on the site
Hi, Calbat,
Could you explain your problem more detailed?
Thank you!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations