How can I access Chart properties through VBA in PowerPoint 2007?

G

Guest

With the change to Excel style Graphs I can longer find the chart objects in
the PowerPoint 2007 object model. Anyone located the Chart objects in
PowerPoint 2007?
 
S

Steve Rindsberg

Takeyabue said:
With the change to Excel style Graphs I can longer find the chart objects in
the PowerPoint 2007 object model. Anyone located the Chart objects in
PowerPoint 2007?

My, my. They sure do a good job of keeping it hidden in Help, don't they?
I've spent quite a bit of time on this now and still haven't come up with
anything useful, but I've asked elsewhere and will post back if I learn
anything new.

Thanks for bringing this up. It definitely needs addressing in the help
system.
 
S

Steve Rindsberg

Takeyabue said:
With the change to Excel style Graphs I can longer find the chart objects in
the PowerPoint 2007 object model. Anyone located the Chart objects in
PowerPoint 2007?

I have an update for you, one I don't like and that you won't like either:

The chart object isn't exposed in the object model.

Yeah. I'm stunned too, but I have it from a trusted source.
 
S

Steve Rindsberg

Todd Wilkes said:
Is this only in the trial version? Will it be exposed for final release?

No, this is the real thing.
Will it be exposed later? The chart object is (or at least was) exposed in
the online demonstration. Will it be exposed via .VS Tools for Office? This
seems like a huge hole and disappoints me greatly.

If you have VBA code that works with the online demo (which I've never had
reason to try) squirt an example along and I'll be happy to try it in the
released version.

I don't know whether it'll be exposed to VSTO or other; perhaps someone with
that can step in and test.
 
S

Steve Rindsberg

Todd Wilkes said:
I appologize, I meant Shape object instead of Slide. So please replace Shape
for all occurances of Slide.

My unconscious beat you to it. <g>
 
S

Steve Rindsberg

I'd never actually tried to do anything with it, but as a test I'd started
up the online demo and found that Slide had a Chart property that doesn't
exist in the Office 2007 downloadable demo for PowerPoint. I was going under
the assumption that it worked. :)

I see. I suppose the online demo might have been built from an earlier beta
release of PPT. Things change along the way, as you know.
With the Office 2007 trial and VSTO SE the Chart property is missing from
the Slide object. The Slide object does retain the HasChart property though,
which I found odd if the Chart property was to be removed permanently. I had
(again) assumed that Chart would be added (back?) in for the release version.

I think they've got a guy named Tantalus working there. He leaves little bits
like this to string us along. Evil little troll. MSGraph charts have
something similar ... a HasLinks property so you can test to see if the chart
data is linked from another source, but there's no way to get at the data or
the path to it. "Nyah nyah nyah" you can just hear it saying.
Is there no way to access charts programmatically while PowerPoint 2007 is
running? The OLEFormat property appears to be undefined with the new charts
though still works with older .ppt files.

The new charts are not OLEEmbedded objects, so they have no OLEFormat property.

The same seems true of charts in Word, by the way. No help there either. I
tried copy/pasting the chart into Excel to see if I could get at it that way
too. No joy. The chart pastes but with no data.

But here's a thought:
Save the presentation as a PPTX file
Locate the file in Windows Exploder and tack on a .ZIP extension
Doubleclick it
Burrow down to \ppt\charts\
You should find some "files" like Chart1.xml
Open one of those in a text editor and see if you like the results.
 
S

Steve Rindsberg

The same seems true of charts in Word, by the way. No help there either. I
Ah, but pasting the other way around seems to paste the data into PPT. Hmmm.
At least in the trial version - MS should just sell me a key now. Guess I can
wait a few weeks.

Yep, you can copy/paste from Excel to PPT but you get a .Type 3/Chart object, same
as if you'd inserted the chart directly into PPT, and no way in with VBA.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top