Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.charting
|
|||
|
|||
![]()
The message below is in response to a solution for my question of whether it
is possible to build a macro that will export multiple Excel charts to a PowerPoint presentation with one chart to a slide. The "responder" gave me an ingenious solution that works perfectly. My next question is if those charts can be automatically resized. Keep reading for details. Jon, This is working brilliantly. I'd like to throw one more challenge at you if you don't mind. Is there a way to output the charts to PowerPoint with the following parameters: Height 5.66 inches Width 9.66 inches Horizontal Position 0 inches from top left corner Vertical Position 1 inch from top left corner Here is the current code I'm using for the macro (you'll notice that I removed the line/command that copies the chart as a picture. This is intentional.): 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 ' Reference existing instance of PowerPoint Set PPApp = GetObject(, "Powerpoint.Application") ' Reference active presentation Set PPPres = PPApp.ActivePresentation PPApp.ActiveWindow.ViewType = ppViewSlide For iCht = 1 To ActiveSheet.ChartObjects.Count ' copy chart as a picture ActiveSheet.ChartObjects(iCht).Copy ' 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 ' align the chart PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters, True PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles, True End With Next ' Clean up Set PPSlide = Nothing Set PPPres = Nothing Set PPApp = Nothing End Sub Many thanks in advance! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
insert excel charts as objects | Charts and Charting in Excel | |||
insert excel charts as objects | Excel Discussion (Misc queries) | |||
Excel should heavily extend the options for black-white charts | Charts and Charting in Excel | |||
Excel Charts | Charts and Charting in Excel | |||
Urgent help! how to automatically resize all the charts? | Excel Worksheet Functions |