跳到主要内容

如何从Excel工作表播放视频文件?

您是否曾经尝试从工作表中播放视频文件? 在本文中,我将讨论一些有趣的技巧,这些技巧可帮助您播放从Excel工作簿存储在计算机中的视频文件。

通过设置Windows Media Player的属性来播放工作表中的视频文件

通过单击命令按钮来播放工作表中的视频文件


箭头蓝色右气泡 通过设置Windows Media Player的属性来播放工作表中的视频文件

在Excel中,有一个有用的控件- 视窗媒体播放 可以帮助您播放视频文件,请执行以下操作:

1。 点击 开发商 > 插页 > 更多控件,请参见屏幕截图:

doc播放影片1

2。 在 更多控件 对话框,滚动并选择 Windows媒体播放器 选项,然后单击 OK 按钮关闭对话框,然后拖动鼠标绘制一个 视窗媒体播放 对象,请参见屏幕截图:

doc播放影片2

3。 然后去看看 查看房源 通过单击对话框 开发商 > 查看房源查看房源 对话框,请执行以下操作:

(1.)在 拼音 标签,请从 全屏 领域;

(2.)复制并粘贴您的视频文件路径,该路径应包括文件扩展名。 网址 领域。

doc播放影片3

4。 完成以上设置后,请退出 设计模式,并且您正在播放指定的视频。


箭头蓝色右气泡 通过单击命令按钮来播放工作表中的视频文件

如果要使用命令按钮播放视频文件,请在单击命令按钮时弹出一个浏览窗口,让您选择要播放的视频文件。 以下步骤可以为您提供帮助:

1。 根据方法1中的步骤2-1插入 Windows媒体播放器 控件,然后继续单击 开发商 > 插页 > 命令按钮 要插入命令按钮,请参见屏幕截图:

doc播放影片4

2。 然后右键单击“命令按钮”,然后选择 查看房源 从上下文菜单中,弹出 查看房源 对话框中键入文本 播放视频 在...旁边 标题 场下 拼音 标签,请参见屏幕截图:

doc播放影片5

3。 然后关闭 查看房源 对话框,然后双击命令按钮,然后复制并粘贴以下VBA代码以将原始代码替换为 Microsoft Visual Basic应用程序 窗口。

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 是您插入的命令按钮名称, 视窗媒体播放器1 是您插入的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 Tab 为 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