code to update a collection of linked excel graphs

  • Thread starter Thread starter brettdj
  • Start date Start date
B

brettdj

I'm pretty proficient in Excel VBA but not PowerPoint so I've been
stumped on a question by a user who wants to update selected
PowerPoint charts linked to Excel files.

I can force the Edit-Links-Update Now command by using
SendKeys "(%EK{DOWN}%U{TAB}~)"
but IMO this is rather ugly even if it does work

The user was trying code such as
ActiveWindow.Selection.SlideRange.Shapes("Object 5").Select
ActiveWindow.Selection.ShapeRange.OLEFormat.DoVerb Index:=1

I tried the procedure at
http://support.microsoft.com/default.aspx?scid=kb;EN-US;251337
but this produces error 438

I'm also a little confused re the Embedded v Linked types, I thought
linked graphs could only be Linked types but in posts I've seen other
users have tried code to update Embedded Excel links

Any help or pointers would be much appreciated

Cheers

brettdj
 
See below

--

Steve Rindsberg PPT MVP
PPTLive ( http://www.pptlive.com ) Featured Speaker
PPTools: http://www.pptools.com
PPT FAQ: http://www.pptfaq.com


brettdj said:
I'm pretty proficient in Excel VBA but not PowerPoint so I've been
stumped on a question by a user who wants to update selected
PowerPoint charts linked to Excel files.

I can force the Edit-Links-Update Now command by using
SendKeys "(%EK{DOWN}%U{TAB}~)"
but IMO this is rather ugly even if it does work

The user was trying code such as
ActiveWindow.Selection.SlideRange.Shapes("Object 5").Select
ActiveWindow.Selection.ShapeRange.OLEFormat.DoVerb Index:=1

I tried the procedure at
http://support.microsoft.com/default.aspx?scid=kb;EN-US;251337
but this produces error 438

At what point in the code? Or does it fail on compile?
The instrux there mention adding a reference to the Excel object library.
That's the one that usually stumps people ... did you do that?
I'm also a little confused re the Embedded v Linked types, I thought
linked graphs could only be Linked types but in posts I've seen other
users have tried code to update Embedded Excel links

A little terminological confusion here.
OLE (which by any other name would smell just as Actively X) means Object
Linking and Embedding.

That's actually two different things that share a name: Linking.
Embedding.

Excel data, charts and such are either linked or embedded, not both.

Embedded objects don't need updating because there's no file "out there"
that might have changed when PPT wasn't looking.

The code in the web page you mention only works on linked objects because of
this line:

If oShape.Type = msoLinkedOLEObject Then
 
Back
Top