PPT 2007 Need to Programmatically Edit Data in Charts

S

soundchaser59

Up until now I have been generating PPT files by opening a PPT template,
pulling records from Access, and using VBA code to populate the tables and
graphs on the slides with data from the Access queries. The tables are easy,
while the graphs I updated by putting data values into the graph's datasheet
cells.

Now with PPT 2007 the graphs are different. The datasheet is more like an
Excel worksheet, with a "Chart" tab and a "Sheet1" tab at the bottom. I have
tried every syntax I can think of to talk to this new type of datasheet using
VBA, but nothing works.

Now I read on various forums that the new PPT 2007 Chart object does not
expose any methods that can be addressed using VBA.

So I started writing an application to manipulate PPT slides using VB.Net.
But I cannot find any examples that show how to use VB.Net code to
programmatically update the data in the sheet behind the chart.

What is the big secret to updating the Sheet1 cells in PPT 2007 charts?
Where is the documentation for the 2007 PPT object model? I cant believe the
ability to address datasheet cells direclty in code has been taken away. Does
anybody know how to do this without going back to the old MSGraph model?

Thanks for any help!
SC
 
S

Steve Rindsberg

Soundchaser59 said:
Up until now I have been generating PPT files by opening a PPT template,
pulling records from Access, and using VBA code to populate the tables and
graphs on the slides with data from the Access queries. The tables are easy,
while the graphs I updated by putting data values into the graph's datasheet
cells.

Now with PPT 2007 the graphs are different. The datasheet is more like an
Excel worksheet, with a "Chart" tab and a "Sheet1" tab at the bottom.

It *is* an Excel worksheet now. Excel has replace MSGraph as the charting
engine for PowerPoint
I have
tried every syntax I can think of to talk to this new type of datasheet using
VBA, but nothing works.

Now I read on various forums that the new PPT 2007 Chart object does not
expose any methods that can be addressed using VBA.

So I started writing an application to manipulate PPT slides using VB.Net.
But I cannot find any examples that show how to use VB.Net code to
programmatically update the data in the sheet behind the chart.

I could be wrong, but I don't think the methods you need are exposed via the
object model, whether to VBA or other languages.
 
S

soundchaser59

So it is no longer possible to programmatically update the data in the
slides? The only way is if we continue using MSGraph in all of our
PowerPoints? Can the new charts be converted back to MSGraph? Or do they have
to be removed and replaced with MSGraphs? If the new chart IS a worksheet,
why would Microsoft lock it down and not let any code talk to the worksheet?
There is no way to address the worksheet in code? If true, that really throws
a huge wet blanket on our business. We do thousands of code-generated PPTs
with cleint specific data in each presentation.

How do we make the legacy MSGraph object available to PPT 2007 users?
SC
 
S

Steve Rindsberg

Soundchaser59 said:
So it is no longer possible to programmatically update the data in the
slides? The only way is if we continue using MSGraph in all of our
PowerPoints?

That's my understanding. But if you poke around the object browser, you'll see a
fair amount of stuff suggesting that the needed bits are there, they're just not
hooked up and exposed at the top-level object.

IOW, we'll probably see it made available, but we don't know when.
Can the new charts be converted back to MSGraph? Or do they have
to be removed and replaced with MSGraphs?

PPT will convert from MSGraph to the new format but not backward.
If the new chart IS a worksheet,
why would Microsoft lock it down and not let any code talk to the worksheet?

I don't know (not an MS employee). But I'm guessing that part of the app wasn't
in shipshape shape to ship and wasn't widely important enough to delay shipping
Office 2007 as a whole.
There is no way to address the worksheet in code? If true, that really throws
a huge wet blanket on our business. We do thousands of code-generated PPTs
with cleint specific data in each presentation.

Believe me, I hear and sympathize. It affects lots of us.
How do we make the legacy MSGraph object available to PPT 2007 users?

There's a simple registry fix you can do on each computer:

Using MSGraph with PowerPoint 2007
http://www.pptfaq.com/FAQ00872.htm
 
S

soundchaser59

Thanks for the confirmation and info. Everything you are saying is matching
everything I am hearing/reading everywhere else online. Bummer! My boss will
not be happy! But I didnt' cause the problem, so it aint all bad!

I will try the registry edit on my machine and see how it goes. I wonder if
MS will re-enable this object model in a service pack? Or if they will make
us wait for Office Vista? hmmmmmm.........curiouser and curiouser......
Thanks again for the info!
SC
 
S

Steve Rindsberg

Soundchaser59 said:
Thanks for the confirmation and info. Everything you are saying is matching
everything I am hearing/reading everywhere else online. Bummer! My boss will
not be happy! But I didnt' cause the problem, so it aint all bad!

I will try the registry edit on my machine and see how it goes. I wonder if
MS will re-enable this object model in a service pack? Or if they will make
us wait for Office Vista? hmmmmmm.........curiouser and curiouser......
Thanks again for the info!

Good luck with the boss ...

Not sure about updates ... we're non-MS volunteers here. There are RSS feeds
you can subscribe to so as to get immediate info about released hotfixes/SPs
for the various Office versions. I was looking for the one for 2007 last night
but couldn't find it.

If anybody knows the URL, please post it.
 
S

Steve Rindsberg

Have a look at this sample. My working assumption is that Office Automation
is EOL and MSFT expects us to migrate to the Open XML SDK.

Open XML is another way of doing things, but honestly, I don't think Office
Automation is anywhere near EOL. Too many large customers have too much invested
in OA.
 
D

DPMaster

Just wondering if anyone had an update on this issue, have any updates been
released which allow you to update charts using VBA or do we need to use the
Open XML route ?
 

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