excel - Powerpoint 自动更新图表链接宏
问题描述
我正在努力寻找有关如何制作宏以更新指向在 Powerpoint 演示文稿中链接的 Excel 图表的链接的信息。演示文稿设置在循环上,Excel 电子表格始终在后台打开。到目前为止,我有这个,但它似乎不起作用
Private Sub WebBrowser1_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean)
ActivePresentation.UpdateLinks
End Sub
我还在另一个威胁上找到了这段代码,但我不清楚,如何循环这个 VBA 让我们说在计时器基础上,或者在下一个幻灯片事件上。
Sub update2()
Dim myPresentation As PowerPoint.Presentation
Dim sld As PowerPoint.Slide
Dim shp As PowerPoint.Shape
Dim myChart As PowerPoint.Chart
Dim Wb As Object
Dim App As Object
Set myPresentation = ActivePresentation
For Each sld In myPresentation.Slides
For Each shp In sld.Shapes
If shp.HasChart Then
Set myChart = shp.Chart
myChart.ChartData.Activate
myChart.Refresh
Set Wb = myChart.ChartData.Workbook
Set App = Wb.Application
Wb.Close (0)
End If
Next
Next
App.Quit
End Sub
正如我所提到的,我的演示文稿正在循环播放,其中包含来自同一个电子表格的多个图表。
谢谢
解决方案
推荐阅读
- azure - Azure 管理 API 无法使用 ADAL 进行身份验证
- linux - OpenNMS RADIUS 认证
- events - Xamarin Forms 中本机控件的事件?
- mysql - 我应该自己做密码加密吗?
- angular - 如何在 Angular UI Grid 列中添加 10px 空白空间?
- python - Linux:杀死执行bash命令的python脚本
- verilog - 带有条件语句的always块内的for循环给出意外错误
- python - Watson Studio 是否支持 XML?
- c - 为什么我不能在busybox中用'\ t'模拟自动完成
- python-3.x - 根据列优先级从数据框中删除重复行 - python