每次演示文稿碰到第一张幻灯片时,powerpoint run宏 [英] powerpoint run macro every time presentation hits first slide

查看:58
本文介绍了每次演示文稿碰到第一张幻灯片时,powerpoint run宏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在PowerPoint演示文稿(2007年)中正在运行一个宏,用于更新所有链接的excel数据.如果我手动运行该宏,则可以正常运行,但是我试图将其设置为每次演示文稿返回到第一张幻灯片时都自动运行.

I am have a macro running in my powerpoint presentation (2007) to update all of the linked excel data. The macro works perfectly if I run it manually but I am trying to set it to run automatically every time the presentation gets back to the first slide.

在浏览了一些类似的问题后,我将以下代码放在一起,但似乎不起作用.当我按下幻灯片1时什么也没发生.

I put the following code together after looking through a few similar questions here but it doesn't seem to work. Nothing happens when I hit slide 1.

Sub OnSlideShowPageChange(ByVal SSW As SlideShowWindow)
If SSW.View.CurrentShowPosition = 1 Then

Dim osld As Slide
Dim oshp As Shape
On Error Resume Next
For Each osld In ActivePresentation.Slides
For Each oshp In osld.Shapes
oshp.LinkFormat.update
Next oshp
Next osld

End If
End Sub

有人有什么想法吗?

推荐答案

您的代码似乎正确并且可以正常工作,但是PowerPoint有时无法正确实现OnSlideShowPageChange.

Your code seems correct and should work, but PowerPoint sometimes doesn't properly implement OnSlideShowPageChange.

将ActiveX控件添加到幻灯片(甚至是非幻灯片)通常可以解决该问题.

Adding an ActiveX control to the slide (even off-slide) usually solves the problem.

这篇关于每次演示文稿碰到第一张幻灯片时,powerpoint run宏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆