Charts to Word

M

Mike Waldron

Ian,

I've never moved charts to Word but this code works for
PowerPoint and I would assume a small modification would
do.

Mike

Sub ToPowerPoint()
' copies and paste all charts in the active workbook to
PowerPoint
'=================================
chtcnt = Charts.Count

Dim pp As Object
On Error Resume Next
Set pp = GetObject(, "PowerPoint.Application")
If Err.Number <> 0 Then
Err.Clear
Set pp = CreateObject("PowerPoint.Application")
End If
pp.Visible = True
pp.Presentations.Add

For i = 1 To chtcnt
Charts(i).Activate
ActiveChart.ChartArea.Select
ActiveChart.ChartArea.Copy

With pp.ActivePresentation
.Slides.Add i, ppLayoutBlank
.Slides(i).Shapes.Paste
With .Slides(i).Shapes(1)
.Top = 75
.Left = 5
.Height = 350
End With
End With
Next i
End Sub
 

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