Updating Charts

G

Guest

I developed a PowerPoint (2002) add-in that generates a PowerPoint
presentation by opening an existing PPT file (template) then updating 4
charts, contained in 2 slides. At the time the add-in generates the
presentation, the chart looks OK and the data inside the datasheet is
correct. When I save the PPT file and open it, the charts still dispay the
right numbers. However, when I click on the datasheet, the data shows the
original data from the template and the chart suddenly displays the wrong
numbers (i.e. the original data from the template). What's most bizarre is
that this doesn't happen consistenely. Sometimes, when it happens, only 2
out of the 4 charts are wrong. There is no pattern to which charts contain
incorrect data.
 
S

Steve Rindsberg

I developed a PowerPoint (2002) add-in that generates a PowerPoint
presentation by opening an existing PPT file (template) then updating 4
charts, contained in 2 slides. At the time the add-in generates the
presentation, the chart looks OK and the data inside the datasheet is
correct. When I save the PPT file and open it, the charts still dispay the
right numbers. However, when I click on the datasheet, the data shows the
original data from the template and the chart suddenly displays the wrong
numbers (i.e. the original data from the template). What's most bizarre is
that this doesn't happen consistenely. Sometimes, when it happens, only 2
out of the 4 charts are wrong. There is no pattern to which charts contain
incorrect data.

W/o seeing the code, there's no way to guess why this might be occurring
randomly, but usually the reason for this particular problem is neglecting to
call the MSGraph application's .Update method before calling .Quit

Changes to the data while the chart is open simply update the WMF picture of a
graph but don't update the actual data stored in the OLE object. When you
re-activate the graph manually, you get the original data, so the graph reverts
to its original state.

Calling Update on the graph updates the *data*.
 

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