Paste Chart

G

Guest

I created an entire presentation from vb code. The presentation contains pie
charts, line graphs, and table. When I copy any of the objects or slides from
this presentation and try to paste them into another presenation, I get blank
chart/graph objects. It's as if the paste funtion is pasting an empty
chart/graph object with no datasheet data. Any thoughts? Thanks!!
 
G

Guest

Have you used the 'Paste Special' function under 'Edit' and just pasted it as
a picture?
 
G

Guest

Thanks for the reply. That doesn't quite work because, in some cases, I'm
actually trying to paste 10 slides, each containing 2 graphs. It would be
inefficient to always manually cut and paste 20 objects. I'm trying to get at
the root of the problem which, I think, has something to do with the
datasheet.

Here's something else I've noticed that might help: when i open a pie chart
for editing, it turns into the MSFT default chart object (the one that
appears when you click the Insert/Chart menu option), a bar chart with a
datasheet that has east, west, north as its legend.
 
S

Steve Rindsberg

I created an entire presentation from vb code. The presentation contains pie
charts, line graphs, and table. When I copy any of the objects or slides from
this presentation and try to paste them into another presenation, I get blank
chart/graph objects. It's as if the paste funtion is pasting an empty
chart/graph object with no datasheet data. Any thoughts? Thanks!!

It's always a good idea to mention the PPT version. In this case, maybe
critical.

Posting example code's always a good bet too.
 
S

Steve Rindsberg

Here's something else I've noticed that might help: when i open a pie chart
for editing, it turns into the MSFT default chart object (the one that
appears when you click the Insert/Chart menu option), a bar chart with a
datasheet that has east, west, north as its legend.

Were the charts created via VB in the first place?
Sounds as though they may have been but the code didn't call the MSGraph app's
UPDATE method before quitting. That'll produce this sort of behavior.
 
G

Guest

Thanks, Steve. I think you're on to something here. The code opens a
PowerPoint template file, adds the objects, then saves the template as
something else (see below). I tried running the code but commented out the
code below so as not to save the output file. Interestingly, the chart object
data sheets are correct and I can cut and paste the objects and the slides
themselves. Everything works fine as long as I don't save the the template
file as something else, so I'm thinking it must have something to do with the
code below.

prsPres.SaveAs Filename:="....ppt"

prsPres.Close
PPApp.Quit
Set prsPres = Nothing
Set PPApp = Nothing
 
S

Steve Rindsberg

Thanks, Steve. I think you're on to something here. The code opens a
PowerPoint template file, adds the objects, then saves the template as
something else (see below). I tried running the code but commented out the
code below so as not to save the output file. Interestingly, the chart object
data sheets are correct and I can cut and paste the objects and the slides
themselves. Everything works fine as long as I don't save the the template
file as something else, so I'm thinking it must have something to do with the
code below.

prsPres.SaveAs Filename:="....ppt"

prsPres.Close
PPApp.Quit
Set prsPres = Nothing
Set PPApp = Nothing

I don't see anything unusual about the code above, though you might want to set the
variables to nothing first then quit. Shouldn't really matter, though, I don't think.
 
G

Guest

Good suggestion, Steve, but that didn't seem to work. I tried creating the
presentation, commenting out the save code I gave, and then manually saved it
as another filename and was able to copy and paste the objects without any
problem. Definately gotta be something wrong with the way I'm saving the
file...sigh.
 
S

Steve Rindsberg

Good suggestion, Steve, but that didn't seem to work. I tried creating the
presentation, commenting out the save code I gave, and then manually saved it
as another filename and was able to copy and paste the objects without any
problem. Definately gotta be something wrong with the way I'm saving the
file...sigh.

Copy and paste might work ok but after you've done that, try doubleclicking them to activate
the charts. What happens then?
 
G

Guest

Figured it out. Along the lines of your first suggestion...instead of
objGraph.Application.Update, I used objDataSheet.Application.Update i.e.
updated the datasheet rather than the graph. Thanks for the help, Steve. Much
appreciated!!
 

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