powerpoint run macro every time presentation hits first slide

两盒软妹~` 提交于 2019-12-25 04:26:04

问题


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.

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

anyone have any ideas?


回答1:


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

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



来源:https://stackoverflow.com/questions/39899956/powerpoint-run-macro-every-time-presentation-hits-first-slide

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!