Hi,
I generate monthly excel report with 35 ~ 40 charts.The charts are
distributed in multiple sheets. There is a standard ppt report
template. I manually paste a particular excel chart to particular
slide no. in standard ppt.
Is there any macro to automate pasting a particular chart from excel
to particular slide no. in standard ppt.
Thanks in advance,
sas
Here is an example of a PowerPoint macro that uses the Excel.
Application object to copy a single named chart to the currently
active slide as a starting point for your solution ...
Sub Macro1()
'
' Macro recorded 12/17/2007 by Tom Lavedas
'
Const sPath = "C:\Documents and Settings\tlavedas\My Documents\Script
\Testing\"
On Error Resume Next
Set oXL = GetObject("", "Excel.Application")
If Err.Number <> 0 Then
Set oXL = CreateObject("Excel.Application")
End If
On Error GoTo 0
With oXL
.Workbooks.Open (sPath & "TestChart.xls")
.Workbooks("TestChart.xls").Activate
With .ActiveWorkbook
.Sheets("Sheet1").Select
.ActiveSheet.ChartObjects("Chart 1").Activate
.ActiveChart.ChartArea.Copy
End With
End With
Presentations(1).Windows(1).Activate
ActiveWindow.View.Paste
End Sub
Adjust the XL file name, sheet name and chart name as approriate
(probably in a loop)
I think the macro works better in PowerPoint than Excel because of
macro security issues.
You might also want to do a groups.google search in
microsoft.public.powerpoint for more pointers to complete this.
Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/