PasteSpecial Excel Chart in Powerpoint

D

Dale Fye

I want to use PasteSpecial to embed an Excel chart in a Powerpoint slide. I
have been able to select the chart and copy it using CopyPicture, and I have
been able to use the shape.paste method using the PowerPoint slide object.
However when I try to use the Shape.PasteSpecial method with the PowerPoint
slide object, I get a variety of error messages.

Anyone have an example of this?

Dale
 
E

Ernst Schuurman

I use this code to copy charts into powerpoint presentation.

Set Dwbl = ThisWorkbook.Worksheets("sheetname")
Set Ch = ThisWorkbook.Charts(1)
Ch.Activate
Ch.ChartTitle.Font.Background = xlTransparent
Set ppt = New PowerPoint.Application
ppt.Visible = True
ppt.Presentations.Open "name.ppt"
Set Pres = ppt.ActivePresentation
Ch.Activate
Set Sl = Pres.Slides(n)
Sl.Shapes.Title.TextFrame.TextRange.Text = Ch.ChartTitle.Text
Sl.Shapes.Title.TextFrame.TextRange.Paragraphs(start:=1,
Length:=1).ParagraphFormat.Alignment = ppAlignCenter
Sl.Shapes.Title.TextFrame.TextRange.Font.Size = 18
Ch.ChartTitle.Font.ColorIndex = 15
Sl.Select
Set Grf = Sl.Shapes.AddOLEObject(Left:=20, Top:=110, Width:=630,
Height:=430, _
Filename:=ThisWorkbook.Path & "\" & ThisWorkbook.Name,
Link:=msoTrue)
Grf.LinkFormat.AutoUpdate = ppUpdateOptionManual

As you see the charttitle is used as the title of the slide and the real
charttitle is hidden.
I use a certain presentation over and over, removeing certain slides and
adding new ones.

Regards
Ernst Schuurman
 
D

Dale Fye

Thanks, Ernst.

I'll give this a try in the morning.

Ernst Schuurman said:
I use this code to copy charts into powerpoint presentation.

Set Dwbl = ThisWorkbook.Worksheets("sheetname")
Set Ch = ThisWorkbook.Charts(1)
Ch.Activate
Ch.ChartTitle.Font.Background = xlTransparent
Set ppt = New PowerPoint.Application
ppt.Visible = True
ppt.Presentations.Open "name.ppt"
Set Pres = ppt.ActivePresentation
Ch.Activate
Set Sl = Pres.Slides(n)
Sl.Shapes.Title.TextFrame.TextRange.Text = Ch.ChartTitle.Text
Sl.Shapes.Title.TextFrame.TextRange.Paragraphs(start:=1,
Length:=1).ParagraphFormat.Alignment = ppAlignCenter
Sl.Shapes.Title.TextFrame.TextRange.Font.Size = 18
Ch.ChartTitle.Font.ColorIndex = 15
Sl.Select
Set Grf = Sl.Shapes.AddOLEObject(Left:=20, Top:=110, Width:=630,
Height:=430, _
Filename:=ThisWorkbook.Path & "\" & ThisWorkbook.Name,
Link:=msoTrue)
Grf.LinkFormat.AutoUpdate = ppUpdateOptionManual

As you see the charttitle is used as the title of the slide and the real
charttitle is hidden.
I use a certain presentation over and over, removeing certain slides and
adding new ones.

Regards
Ernst Schuurman
 
A

avivexpert

Dale Fye wrote on 11/06/2007 12:47 ET :
I want to use PasteSpecial to embed an Excel chart in a Powerpoint slide. I
have been able to select the chart and copy it using CopyPicture, and I have
been able to use the shape.paste method using the PowerPoint slide object.
However when I try to use the Shape.PasteSpecial method with the PowerPoint
slide object, I get a variety of error messages.

Anyone have an example of this?

Dale

Email address is not valid.
Please reply to newsgroup only.
I suggest to try using Ezpaste-xl2anywhere (www.ezpaste.net). It will solve al
the problems of copying charts and tables from Excel to Powerpoint or Word

AvivExpert
 

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