LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Copy excel chart as picture to a particular ppt slides

On Dec 17, 5:58 am, sas wrote:
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/
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Copy Chart as Picture Steph Charts and Charting in Excel 3 April 23rd 23 11:47 AM
Copy and Paste Chart as Picture into another workbook or worksheet SteveC Charts and Charting in Excel 1 February 15th 07 11:47 PM
Excel 2007 copy chart as picture ward376 Charts and Charting in Excel 3 June 2nd 06 09:48 PM
copy then paste a chart as a picture Bin[_3_] Excel Programming 1 June 17th 05 05:56 AM
copy charts & paste as picture, hide chart, size & place same picture as chart Gunnar Johansson Excel Programming 0 October 30th 04 01:22 AM


All times are GMT +1. The time now is 07:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"