且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在幻灯片中显示时,PowerPoint中的链接Excel对象不会更新

更新时间:2023-02-14 08:39:37

我已经使用此代码解决了上述问题

I've solve the problem above using this code

Sub OnSlideShowPageChange(ByVal SSW As SlideShowWindow)
    If SSW.View.CurrentShowPosition = 2 Then
        ActivePresentation.UpdateLinks
    End If
End Sub

假设我有2张幻灯片,当幻灯片2通过时,它将触发更新链接,并使用更新的OLE链接循环回到幻灯片1.我花了很多时间才能读到这个部分,但是当我开始表演时,我无法运行它.我必须手动按alt + F8并单击运行",这样代码才能循环播放每张幻灯片2.

Assuming I have 2 slides in the show, when is passes on slide 2 it will trigger the update links and loops back to slide 1 with the updated OLE links. It took me a lot of reading to get to this part but I cant get it to run when I start the show. I have to manually press alt+F8 and click run so the code will loop every slide 2.

终于让它运行而无需运行宏.我只是打开幻灯片并播放节目.当节目通过幻灯片2或刚开始时,更新是动态更新的.现在,仍然有一些解决此问题的方法,希望对您有帮助.

Finally got it working without running the macro once. i just open the powerpoint and play the show. the updates were dynamically updated when the show passed slide 2 or just the beginning. Now there are some that still dont have solutions for this problem, hope this helps you.

我利用了在 http://skp.mvps.org/autoevents.htm上找到的autoevent.zip. .我安装了zip中包含的AutoEvents.ppa作为插件,并在PPT2007和PPT2003中将其激活.然后使用此代码创建一个普通的模块/宏.

I utilized the autoevent.zip found here at http://skp.mvps.org/autoevents.htm. I installed the AutoEvents.ppa included in the zip as an Add In and activated it in PPT2007 and PPT2003. and then created a normal module/macro with this code.

Sub Auto_ShowBegin()
ActivePresentation.UpdateLinks
End Sub
Sub OnSlideShowPageChange(ByVal SSW As SlideShowWindow)
'
' AUTO UPDATE OF OLE LINKS MACRO
'
    If SSW.View.CurrentShowPosition = 2 Then
        ActivePresentation.UpdateLinks
    End If
End Sub

您完成了.请确保在2003和2007中都将您的Powerpoint保存为启用宏的格式,这是因为我有两个版本的ms office.并在勾选框上打勾-信任对VBA项目对象模型的访问.还要循环播放幻灯片,以便当它通过幻灯片2或刚开始放映时,它将更新所有OLE链接.

And your done. Please make sure that you save your powerpoint in macro-enabled format both for 2003 and 2007, this is because I have two versions of ms office. and tick the ckeck box saying -Trust access to the VBA project object model. Also loop your slideshow so that when it passed the slide 2 or just the beginning of the show, it will update all OLE links.

如果我错过了一些事情,请发表评论. 希望这会有所帮助.

Do comment if I have missed something. Hope this helps.