LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 7
Default Multiple Excel Charts to PowerPoint 2

I am following on from an older post
http://groups.google.com/group/micro...af87f70b6657f?

I have used Jon Peltier's page http://peltiertech.com/Excel/XL_PPT.html#chartppt
to try and create a macro that will open a new PPT, copy all th
echartsheets and paste as bitmap (to stop people falsifying charts!)
one to a ppt slide.

My problems a

1) The macro only seems to work if PPT is already running (despite
using Jon's code for creating a New PPT object)

2) The bitmap solution is ok when on screen but I get people asking if
their eyes are playing tricks when we look at the printed copy. Yes
it is a bit fuzzy! What controls the resolution of a bitmap? Is it
the screen resolution?

Is there any way to prevent ungrouping of a picture?

3) Can I define the PPT template (.pot) that should be used?

4) What decides the dimensions (points, inches, cm) used for
positioning? - Are they set by the Windows regional settings?

The code is below (you can see where I have added sections - extra
indent)

I am so close to my goal but am stuck with these last few points!

Can anyone help?

Steve




Sub ChartstoPresentation()
' Set a VBE reference to Microsoft PowerPoint Object Library


Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
Dim PresentationFileName As Variant
Dim SlideCount As Long
Dim iCht As Integer


' Create instance of PowerPoint
Set PPApp = CreateObject("Powerpoint.Application")

' Create a presentation
Set PPPres = PPApp.Presentations.Add

' Some PowerPoint actions work best in normal slide
view
PPApp.ActiveWindow.ViewType = ppViewSlide

' Add first slide to presentation
Set PPSlide = PPPres.Slides.Add(1, ppLayoutTitleOnly)


' Reference existing instance of PowerPoint
'Set PPApp = GetObject(, "Powerpoint.Application")

' Reference active presentation
'Set PPPres = PPApp.ActivePresentation

' Some PowerPoint actions work best in normal slide view
'PPApp.ActiveWindow.ViewType = ppViewSlide

For iCht = 1 To ActiveWorkbook.Charts.Count
' Copy chartsheet as a picture
ActiveWorkbook.Charts(iCht).CopyPicture _
Appearance:=xlScreen, Size:=xlScreen,
Format:=xlBitmap

'For iCht = 1 To ActiveSheet.ChartObjects.Count
' Copy chart as a picture
' ActiveSheet.ChartObjects(iCht).Chart.CopyPicture _
' Appearance:=xlScreen, Size:=xlScreen, Format:=xlPicture

' Add a new slide and paste in the chart
SlideCount = PPPres.Slides.Count
Set PPSlide = PPPres.Slides.Add(SlideCount + 1, ppLayoutBlank)
PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideIndex
With PPSlide
' paste and select the chart picture
.Shapes.Paste.Select
' position the chart
With PPApp.ActiveWindow.Selection.ShapeRange
.Top = 94 ' points
.Left = 58 ' points
.Width = 8.2 * 72
.Height = 5.6 * 72
End With
End With


Next


' Clean up
Set PPSlide = Nothing
Set PPPres = Nothing
Set PPApp = Nothing


End Sub
 
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
Multiple Excel Charts to PowerPoint mustang25 Charts and Charting in Excel 22 September 2nd 08 05:10 AM
Excel charts copied to powerpoint Meg Partridge Charts and Charting in Excel 3 August 22nd 08 06:07 AM
How to place excel charts into PowerPoint w/out distortion? howard Charts and Charting in Excel 3 January 18th 07 05:44 PM
Help! How to add many excel charts into PowerPoint at once? Joules Charts and Charting in Excel 1 July 13th 06 06:58 PM
Excel spreadsheets with data, Powerpoint charts... and VBA! Petitboeuf Excel Discussion (Misc queries) 1 May 26th 06 11:15 AM


All times are GMT +1. The time now is 07:51 AM.

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

About Us

"It's about Microsoft Excel"