Weird chart problem with Powerpoint 2002

J

John Davies

I have an automation program that changes the data in an existing PPT chart.
A simple example of my code is:

Set datasheet = sha.OLEFormat.object.Application.datasheet

For j = 1 To 4
datasheet.Cells(1, j + 1) = m_currentYear - (4 - j)
Next j

It works great. The problem comes when the double click on the chart to
bring up the data table. When they do that, the data reverts to what it
originally was when the file was first created.

Any idea how I can make this elephant forget?

Thanks,
John
 
S

Steve Rindsberg

John Davies said:
I have an automation program that changes the data in an existing PPT chart.
A simple example of my code is:

Set datasheet = sha.OLEFormat.object.Application.datasheet

For j = 1 To 4
datasheet.Cells(1, j + 1) = m_currentYear - (4 - j)
Next j

It works great. The problem comes when the double click on the chart to
bring up the data table. When they do that, the data reverts to what it
originally was when the file was first created.

If I have it right, what's happening is that you're modifying a copy of the
data in MSGraph but not the actual data in the PPT file.

A call to Application.Update before Application.Quit should fix it.
 
J

John Davies

That sounds right. I'll try it tonight and post again.

Thanks for your help.
 
J

John Davies

Steve-

That didn't do it. There isn't an Application.Update in 2002. I tried
Presentation.UpdateLinks because it was the closest but no joy.
 
J

John Davies

I got it now!

The update is on the graph object.

Thanks for your help. I can go to bed early tonight for a change.
 
W

WendyL

Hi
I am getting the same problem, but only occasionally and "randomly" (there
seems to be no pattern to when it happens, and I can't replicate it). I am
already using Application.Update & Application.Quit on the Graph object.

Any thoughts as to what might be causing the problem? Is it possible that
sometimes the Update doesn't get executed properly for some reason?
 

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