Chart in PowerPoint

T

Techno_Dex

Does anyone know how to overcome the data removal problem when using a Chart
from the MSGraph class in a PPT presentation? I am creating a Chart and
load the Chart's Application.DataSheet with my own data at run time (i.e.
building a Table using the cells in the DataSheet to add ranges of data to
the cells). I then add the Chart as a Shape to the PowerPoint presentation.
My problem is once the presentation is saved and opened, if a user wants to
change the data, then they should be able to double click on the chart and
edit the DataSheet. What is happening is the DataSheet doesn't show up with
my custom data, rather it shows what appears to be a new DataSheet with
default data in it. If I click off the Chart, then my Chart is replaced
with the standard default Chart like I was starting from scratch. Does
anyone have any ideas on this?
 
S

Steve Rindsberg

Does anyone know how to overcome the data removal problem when using a Chart
from the MSGraph class in a PPT presentation? I am creating a Chart and
load the Chart's Application.DataSheet with my own data at run time (i.e.
building a Table using the cells in the DataSheet to add ranges of data to
the cells). I then add the Chart as a Shape to the PowerPoint presentation.
My problem is once the presentation is saved and opened, if a user wants to
change the data, then they should be able to double click on the chart and
edit the DataSheet. What is happening is the DataSheet doesn't show up with
my custom data, rather it shows what appears to be a new DataSheet with
default data in it. If I click off the Chart, then my Chart is replaced
with the standard default Chart like I was starting from scratch. Does
anyone have any ideas on this?

MSGraph's .Update method before you use .Quit
 
T

Techno_Dex

Very simple and too the point. Thanks it worked like a charm. It looks
like I need to do a little more reading on MSGraph charts as I wasn't using
Update() or Quit() which appear to clean up and finalize the Charts I was
creating.

(FYI: I had to use the oChart.Application.Update() method for anyone else
having this problem.)
 
S

Steve Rindsberg

Very simple and too the point. Thanks it worked like a charm.

I thought it might. It's kind of a classic set of symptoms that you described.
<g>

Conceptually, what seems to be going on is:

- Your code activates the MSGraph OLE object held in the host/container app
(Ie, PPT)

- This creates an instance of the object in MSGraph that you can work with, but
it's independent of the instance embedded in the container app

- Application.Update applies your changes to the embedded instance of the
object



It looks
 

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