PDA

View Full Version : Disable Update Link Prompts



asingh
03-22-2006, 07:49 AM
Hi All,
I needed help for the following...
I have a PPT that retrieves values from an excell Sheet. When I open the PPT i get a prompt "to update the links". I want this prompt to be disabled..but the links should get updated respectively.

thanks a lot
Asingh

Killian
03-22-2006, 05:37 PM
Hi there,

This is possible, but if I understand things correctly, not very straight forward.

You can stop your linked chart objects from triggering the message by running the following code to change its "LinkFormat.AutoUpdate" property (which determines its behaviour when the presentation is opened)For Each sld In ActivePresentation.Slides
For Each sh In sld.Shapes
If sh.Type = msoLinkedOLEObject Then
If Left(sh.OLEFormat.ProgID, 11) = "Excel.Sheet" Then
sh.LinkFormat.AutoUpdate = ppUpdateOptionManual
End If
End If
Next
Next Then save the presentation. You will not get the message but your objects won't update.
You can run some code to update themFor Each sld In ActivePresentation.Slides
For Each sh In sld.Shapes
If sh.Type = msoLinkedOLEObject Then
If Left(sh.OLEFormat.ProgID, 11) = "Excel.Sheet" Then
sh.LinkFormat.Update
End If
End If
Next
Next but to do this automatically when your presentation opens is not ordinarily possible because there are no presentation events (like "presentation_open") available.

A procedure in a standard module named "Auto_Open" will run but only in a file saved as an addin. That procedure will run when the addin loads.

The only way I can think of to trigger this for an individual pres is to use an addin that enables application events in powerpoint (KB article here (http://vbaexpress.com/kb/getarticle.php?kb_id=327)) and use the application's Presentation_Open event to check for the pres ny name and then run the update code.

I told you it wasn't straight forward. :eek:

or maybe I'm missing something obvious :confused2

asingh
03-23-2006, 04:31 PM
Thanks a lot Killlian,
By using the add-in u suggested and the code you provided..I was able to see "events" in my PPT's. Its working fine now...


regards

asingh